Beispiel #1
0
 public virtual void RecordBehaviorLog(Agent agent, BehaviorRunType runType, BehaviorType behaviorType, bool interruptFromBehavior = false)
 {
     agentsBehaviorLogs[agent].Add(new BehaviorLog()
     {
         time                  = Time.time,
         runType               = runType,
         behaviorType          = behaviorType,
         interruptFromBehavior = interruptFromBehavior
     });
 }
Beispiel #2
0
        public void ResetBehavior()
        {
            behaviorType     = null;
            isRunning        = false;
            isWaiting        = false;
            waitTime         = 0f;
            startedWaitingAt = 0f;
            wasInterrupted   = false;
            lastOCUpdateTime = 0f;

            behaviorContext.Reset();
        }
Beispiel #3
0
        // Can already be interrupted due to BeforeStart OutputChanges failing
        public void StartBehavior(ActionType actionType, Entity target, List <Selector> attributeSelectors, bool wasInterrupted)
        {
            behaviorType = actionType.behaviorType;
            behaviorContext.Set(actionType, target, attributeSelectors);

            isRunning           = true;
            this.wasInterrupted = wasInterrupted;
            lastOCUpdateTime    = Time.time;

            behaviorType.SetContext(agent, behaviorContext);
            agent.historyType.RecordBehaviorLog(agent, HistoryType.BehaviorRunType.Started, behaviorType);
            behaviorType.StartBehavior(agent);
            agent.StartCoroutine(UpdateBehavior());
        }
Beispiel #4
0
 public override void RecordBehaviorLog(Agent agent, BehaviorRunType runType, BehaviorType behaviorType, bool interruptFromBehavior = false)
 {
 }