Skip to content

Commit a748adf

Browse files
committed
fix: fix potential issues
1 parent 40ff828 commit a748adf

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

Packages/src/Runtime/Internal/Extensions/ComponentExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ internal static void ConvertTo<T>(this Object context) where T : MonoBehaviour
204204
target.enabled = false;
205205

206206
// Find MonoScript of the specified component.
207-
foreach (var script in Resources.FindObjectsOfTypeAll<MonoScript>())
207+
foreach (var script in MonoImporter.GetAllRuntimeMonoScripts())
208208
{
209209
if (script.GetClass() != typeof(T))
210210
{

Packages/src/Runtime/Internal/Utilities/PowerRangeAttribute.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
using System;
2+
using System.Diagnostics;
23
using UnityEditor;
34
using UnityEngine;
45

56
namespace Coffee.UIEffectInternal
67
{
78
[AttributeUsage(AttributeTargets.Field)]
9+
[Conditional("UNITY_EDITOR")]
810
public sealed class PowerRangeAttribute : PropertyAttribute
911
{
1012
public readonly float min;

Packages/src/Runtime/UIEffectBase.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,8 @@ public virtual Material GetModifiedMaterial(Material baseMaterial)
136136
protected override void OnValidate()
137137
{
138138
UpdateContext(context);
139-
ApplyContextToMaterial(graphic ? graphic.canvasRenderer.GetMaterial() : _material);
140139
SetVerticesDirty();
141140
SetMaterialDirty();
142-
143-
if (!EditorApplication.isPlaying)
144-
{
145-
EditorApplication.QueuePlayerLoopUpdate();
146-
}
147141
}
148142

149143
protected override void Reset()
@@ -170,7 +164,7 @@ public virtual void SetVerticesDirty()
170164
if (graphic)
171165
{
172166
graphic.SetVerticesDirty();
173-
GraphicProxy.Find(graphic).SetVerticesDirty(graphic, false);
167+
GraphicProxy.Find(graphic).SetVerticesDirty(graphic, enabled);
174168
#if UNITY_EDITOR
175169
EditorApplication.QueuePlayerLoopUpdate();
176170
#endif

0 commit comments

Comments
 (0)