forked from zxl/LaboratoryProtection
23 lines
418 B
C#
23 lines
418 B
C#
|
using Sirenix.OdinInspector;
|
|||
|
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
public class ImageSetter : SetterBase<Image, Sprite>
|
|||
|
{
|
|||
|
#if UNITY_EDITOR
|
|||
|
protected override void Set(Image behaviour, Sprite value)
|
|||
|
{
|
|||
|
behaviour.sprite = value;
|
|||
|
}
|
|||
|
|
|||
|
[Button]
|
|||
|
public void ResetSize()
|
|||
|
{
|
|||
|
foreach (var item in this.behaviours)
|
|||
|
{
|
|||
|
item.SetNativeSize();
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|
|||
|
}
|