protected override BTNodeStatus OnExcute(IAgent agent, Blackboard bb) { AIModel model = ((AIEntity)agent).Model; if (CheckOver(model)) { HTLogger.Warning("死亡!"); return(BTNodeStatus.Finished); } model.Food.Value += BTExampleConsts.DAILY_FOOD_COST * Time.deltaTime; model.Water.Value += BTExampleConsts.DAILY_WATER_COST * Time.deltaTime; model.Energy.Value += BTExampleConsts.DAILY_ENERGY_COST * Time.deltaTime; model.Mood.Value += BTExampleConsts.DAILY_MOOD_COST * Time.deltaTime; return(BTNodeStatus.Running); }
private void Start() { UnityDebugListener unityDebugListener = new UnityDebugListener(); UnityWarningListener unityWarningListener = new UnityWarningListener(); UnityErrorListener unityErrorListener = new UnityErrorListener(); HTLogger.Instance.Init(true); HTLogger.Instance.AddListener(HTLogger.Channel.Info, unityDebugListener); HTLogger.Instance.AddListener(HTLogger.Channel.Todo, unityDebugListener); HTLogger.Instance.AddListener(HTLogger.Channel.Debug, unityDebugListener); HTLogger.Instance.AddListener(HTLogger.Channel.Warning, unityWarningListener); HTLogger.Instance.AddListener(HTLogger.Channel.Error, unityErrorListener); HTLogger.Info("测试 Logger 成功!"); HTLogger.Todo("测试 Logger 成功!"); HTLogger.Debug("测试 Logger 成功!"); HTLogger.Warning("测试 Logger 成功!"); HTLogger.Error("测试 Logger 成功!"); }