Esempio n. 1
0
        public BaseNodeProxy CreateProxy(BaseNode node)
        {
            if (node == null)
            {
                throw new Exception("BehaviorTreeManager.CreateProxy() \n Create nodeProxy failed,node is null.");
            }

            node.Status = NodeStatus.None;

            if (_proxyManager == null)
            {
                throw new Exception($"BehaviorTreeManager.CreateProxy({node.NodeData.ClassType}) \n Create nodeProxy failed,proxyManager is null.");
            }

            var nodeProxy = _proxyManager.Create(node);

            if (nodeProxy == null)
            {
                throw new Exception($"BehaviorTreeManager.CreateProxy({node.NodeData.ClassType}) \n Create nodeProxy failed,ClassType:{node.ProxyData.Name}");
            }

            return(nodeProxy);
        }