summaryrefslogtreecommitdiff
path: root/Client/Assets/Behavior Designer/AI/XAICreateBehaviorTree.cs
blob: 6409d8adc04dc857ea398d1b40ed320c580317de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using UnityEngine;
using BehaviorDesigner.Runtime;
using XUtliPoolLib;

public class CreateTree : MonoBehaviour
{
    public ExternalBehaviorTree behaviorTree;

    void Start()
    {
        BehaviorTree bt = transform.gameObject.AddComponent<BehaviorTree>();
        bt.ExternalBehavior = behaviorTree;
        bt.StartWhenEnabled = false;
    }
}

public class AIMgrUtil
{
    private static IXAIGeneralMgr _ai_general_mgr = null;

    public static IXAIGeneralMgr GetAIMgrInterface()
    {
        if (_ai_general_mgr == null || _ai_general_mgr.Deprecated)
            _ai_general_mgr = XInterfaceMgr.singleton.GetInterface<IXAIGeneralMgr>(XCommon.singleton.XHash("XAIGeneralMgr"));

        return _ai_general_mgr;
    }

}