BehaviorTreeConfig.cs 665 B

1234567891011121314151617181920212223
  1. using UnityEngine;
  2. using System.Collections.Generic;
  3. using System;
  4. namespace Model
  5. {
  6. public class BehaviorTreeConfig : MonoBehaviour
  7. {
  8. public BehaviorNodeConfig RootNodeConfig;
  9. private int mAutoId = 1;
  10. public int AutoId{ get {return mAutoId++;}}
  11. public int RootNodeId { get{ return RootNodeConfig == null ? 0 : RootNodeConfig.id; }}
  12. public NodeProto RootNodeProto
  13. {
  14. get{ return RootNodeConfig == null ? null : RootNodeConfig.ToNodeProto();}
  15. }
  16. public void Clear()
  17. {
  18. DestroyImmediate(RootNodeConfig,true);
  19. RootNodeConfig = null;
  20. }
  21. }
  22. }