fix: fix potential issues

This commit is contained in:
mob-sakai
2025-02-27 09:32:56 +09:00
parent 40ff828ff0
commit a748adf1bd
3 changed files with 4 additions and 8 deletions
@@ -204,7 +204,7 @@ namespace Coffee.UIEffectInternal
target.enabled = false;
// Find MonoScript of the specified component.
foreach (var script in Resources.FindObjectsOfTypeAll<MonoScript>())
foreach (var script in MonoImporter.GetAllRuntimeMonoScripts())
{
if (script.GetClass() != typeof(T))
{
@@ -1,10 +1,12 @@
using System;
using System.Diagnostics;
using UnityEditor;
using UnityEngine;
namespace Coffee.UIEffectInternal
{
[AttributeUsage(AttributeTargets.Field)]
[Conditional("UNITY_EDITOR")]
public sealed class PowerRangeAttribute : PropertyAttribute
{
public readonly float min;
+1 -7
View File
@@ -136,14 +136,8 @@ namespace Coffee.UIEffects
protected override void OnValidate()
{
UpdateContext(context);
ApplyContextToMaterial(graphic ? graphic.canvasRenderer.GetMaterial() : _material);
SetVerticesDirty();
SetMaterialDirty();
if (!EditorApplication.isPlaying)
{
EditorApplication.QueuePlayerLoopUpdate();
}
}
protected override void Reset()
@@ -170,7 +164,7 @@ namespace Coffee.UIEffects
if (graphic)
{
graphic.SetVerticesDirty();
GraphicProxy.Find(graphic).SetVerticesDirty(graphic, false);
GraphicProxy.Find(graphic).SetVerticesDirty(graphic, enabled);
#if UNITY_EDITOR
EditorApplication.QueuePlayerLoopUpdate();
#endif