public void Simulate() { if (Body.PositionChangedBuffer) { tempNode = GridManager.GetNode(Body._position.x, Body._position.y); if (tempNode.IsNull()) { return; } if (System.Object.ReferenceEquals(tempNode, LocatedNode) == false) { if (LocatedNode != null) { LocatedNode.Remove(this); } tempNode.Add(this); LocatedNode = tempNode; } } if (!ReplayManager.IsPlayingBack) { foreach (var AI in AgentAI) { AI.OnSimulate(); } } }
public void Deactivate() { if (LocatedNode != null) { LocatedNode.Remove(this); LocatedNode = null; } }
public void Simulate() { if (Body.PositionChangedBuffer) { tempNode = GridManager.GetNode(Body._position.x, Body._position.y); if (System.Object.ReferenceEquals(tempNode, LocatedNode) == false) { LocatedNode.Remove(this); tempNode.Add(this); LocatedNode = tempNode; } } }