2024-10-31 10:58:14 +08:00
|
|
|
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
using UnityEditor;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace Ether
|
|
|
|
{
|
|
|
|
public class ImageEx : Image
|
|
|
|
{
|
2024-11-01 14:07:47 +08:00
|
|
|
private void OnRectTransformDimensionsChange()
|
|
|
|
{
|
|
|
|
base.OnRectTransformDimensionsChange();
|
|
|
|
Debug.LogError("OnRectTransformDimensionsChange");
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnTransformChildrenChanged()
|
|
|
|
{
|
|
|
|
Debug.LogError("1111111111");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-31 10:58:14 +08:00
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
[MenuItem("GameObject/UIEx/ImageEx", priority = -1000)]
|
|
|
|
private static void CreateButtonEx(MenuCommand menuCmd)
|
|
|
|
{
|
|
|
|
GameObject selection = Selection.activeGameObject;
|
|
|
|
|
|
|
|
CommonExtension.CreateComponent<ImageEx>(selection, (obj) =>
|
|
|
|
{
|
|
|
|
obj.GetComponent<ImageEx>().raycastTarget = false;
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|