public void Update(MyBehaviorTreeDecoratorNodeMemory.LogicMemory logicMemory) { MyBehaviorTreeDecoratorNodeMemory.CounterLogicMemory memory = logicMemory as MyBehaviorTreeDecoratorNodeMemory.CounterLogicMemory; if (memory.CurrentCount == this.CounterLimit) { memory.CurrentCount = 0; } else { memory.CurrentCount++; } }
public void Update(MyBehaviorTreeDecoratorNodeMemory.LogicMemory logicMemory) { MyBehaviorTreeDecoratorNodeMemory.TimerLogicMemory memory = logicMemory as MyBehaviorTreeDecoratorNodeMemory.TimerLogicMemory; if ((((Stopwatch.GetTimestamp() - memory.CurrentTime) / Stopwatch.Frequency) * 0x3e8L) <= this.TimeInMs) { memory.TimeLimitReached = false; } else { memory.CurrentTime = Stopwatch.GetTimestamp(); memory.TimeLimitReached = true; } }
public void Update(MyBehaviorTreeDecoratorNodeMemory.LogicMemory logicMemory) { var memory = logicMemory as MyBehaviorTreeDecoratorNodeMemory.CounterLogicMemory; if (memory.CurrentCount == CounterLimit) { memory.CurrentCount = 0; } else { ++memory.CurrentCount; } }
public bool CanRun(MyBehaviorTreeDecoratorNodeMemory.LogicMemory logicMemory) { var memory = logicMemory as MyBehaviorTreeDecoratorNodeMemory.TimerLogicMemory; return(memory.TimeLimitReached); }
public bool CanRun(MyBehaviorTreeDecoratorNodeMemory.LogicMemory logicMemory) => ((logicMemory as MyBehaviorTreeDecoratorNodeMemory.CounterLogicMemory).CurrentCount == this.CounterLimit);
public bool CanRun(MyBehaviorTreeDecoratorNodeMemory.LogicMemory logicMemory) => (logicMemory as MyBehaviorTreeDecoratorNodeMemory.TimerLogicMemory).TimeLimitReached;
public bool CanRun(MyBehaviorTreeDecoratorNodeMemory.LogicMemory logicMemory) { var memory = logicMemory as MyBehaviorTreeDecoratorNodeMemory.CounterLogicMemory; return(memory.CurrentCount == CounterLimit); }