Example #1
0
        static void TestBTree()
        {
            GameObject         rootObj  = new GameObject("Unit");
            BehaviourTreeOwner owner    = rootObj.AddComponent <BehaviourTreeOwner>();
            BehaviourTree      jsonTree = new BehaviourTree();
            string             path     = "./../../Resources/LLogTree.BT";
            //string path = "./../../Resources/LLogTree.BT";
            string jsonGraph = System.IO.File.ReadAllText(path);

            Console.WriteLine(jsonGraph);

            GraphSerializationData graphData = jsonTree.Deserialize(jsonGraph, true, null);

            owner.StartBehaviour(jsonTree, (bool val) =>
            {
                Loger.Log("StartBehaviour Callback : " + val);
            });
        }