自定义设置Image 扩展
using System; using UnityEngine.UI; using UnityEngine; namespace HutongGames.PlayMaker.Actions { [ActionCategory(ActionCategory.UI)] [Tooltip("设置图片")] public class SetSImage : FsmStateAction { [RequiredField] [UIHint(UIHint.Variable)] public Image Image; [RequiredField] public Sprite sprite; //点击重置调用 public override void Reset() { } //使用OnEnter()代替Start()或OnEnable()。当状态变为活动状态时调用OnEnter。这允许您初始化操作。许多操作也在OnEnter中完成所有工作。 public override void OnEnter() { Image.sprite = sprite; if (!everyFrame) { base.Finish(); } } } }
标签:脚本,额外,OnEnter,sprite,Image,PlayMaker,using,public From: https://www.cnblogs.com/cjlLearn/p/17844456.html