UIScale.cs 635 B

123456789101112131415161718192021222324252627282930313233343536
  1. using Base;
  2. using UnityEngine;
  3. namespace Model
  4. {
  5. public enum AAAA
  6. {
  7. BBBB,
  8. CCCC,
  9. DDDD
  10. }
  11. [Node(NodeClassifyType.Action, "将UI缩放")]
  12. public class UIScale : Node
  13. {
  14. [NodeInput("传入的UI参数", typeof(UI))]
  15. private string uiKey;
  16. [NodeField("缩放倍数")]
  17. private float scale;
  18. [NodeField("111")]
  19. private AAAA aaaa;
  20. public UIScale(NodeProto nodeProto): base(nodeProto)
  21. {
  22. }
  23. protected override bool Run(BehaviorTree behaviorTree, BTEnv env)
  24. {
  25. UI ui = env.Get<UI>(this.uiKey);
  26. ui.GameObject.transform.localScale = new Vector3(this.scale, this.scale, this.scale);
  27. return true;
  28. }
  29. }
  30. }