示例#1
0
文件: Agent.cs 项目: mfagerlund/LD33
 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);
     }
 }
示例#2
0
文件: Agent.cs 项目: mfagerlund/LD33
 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);
     }
 }