コード例 #1
0
 protected override void OnDisable()
 {
     if (ActiveBTEditor == this)
     {
         ActiveBTEditor = null;
     }
     base.OnDisable();
     GraphCanvas.OnMouseClick = null;
     GraphCanvas.OnDragBegin  = null;
     GraphCanvas.OnDrag       = null;
     GraphCanvas.OnDragEnd    = null;
     if (mAssetBinder != null)
     {
         mAssetBinder.updateTreeAsset -= ReloadGraph;
         mAssetBinder.Dispose();
         mAssetBinder = null;
     }
 }
コード例 #2
0
 protected override void OnEnable()
 {
     ActiveBTEditor = this;
     base.OnEnable();
     GraphCanvas.OnMouseClick = InteractCraphClick;
     GraphCanvas.OnDragBegin  = InteractGraphDragBegin;
     GraphCanvas.OnDrag       = InteractGraphDrag;
     GraphCanvas.OnDragEnd    = InteractGraphDragEnd;
     GraphCanvas.OnKeyDown    = InteractGraphKeyDown;
     if (mAssetBinder == null)
     {
         mAssetBinder = new BehaviourTreeAssetBinder();
     }
     mAssetBinder.updateTreeAsset += ReloadGraph;
     if (mAssetBinder.targetTree == null)
     {
         mAssetBinder.SetSelectedAsset();
     }
     else
     {
         ReloadGraph();
     }
 }