Beispiel #1
0
 public void RebuildAi()
 {
     Ai = null;
     if (!string.IsNullOrEmpty(aiFileName))
     {
         TextAsset aiCode = Resources.Load <TextAsset>(aiFileName);
         if (aiCode == null)
         {
             Debug.LogFormat("Unable to find code for {0}", aiFileName);
             return;
         }
         AgentBlackboard agentBlackboard = new AgentBlackboard(this);
         _compiler = _compiler ?? new BehaviourTreeCompiler <AgentBlackboard>();
         Ai        = _compiler.Compile(agentBlackboard, aiCode.text);
     }
 }
Beispiel #2
0
 public void RebuildAi()
 {
     Ai = null;
     if (!string.IsNullOrEmpty(aiFileName))
     {
         TextAsset aiCode = Resources.Load<TextAsset>(aiFileName);
         if (aiCode == null)
         {
             Debug.LogFormat("Unable to find code for {0}", aiFileName);
             return;
         }
         AgentBlackboard agentBlackboard = new AgentBlackboard(this);
         _compiler = _compiler ?? new BehaviourTreeCompiler<AgentBlackboard>();
         Ai = _compiler.Compile(agentBlackboard, aiCode.text);
     }
 }