public override void tick() { if (toLaunch != null) { // If we're not waiting to receive event finished from Mover. if (movement == null) { // That means that, we're in the right position so... IsoUnity.Game.main.enqueueEvent(toLaunch); toLaunch = null; // Look to the action if (actionCell || actionEntity) { IsoUnity.Entities.Mover.Direction toLook = IsoUnity.Entities.Mover.getDirectionFromTo(Entity.transform, actionEntity ? actionEntity.transform : actionCell.transform); IsoUnity.GameEvent ge = new IsoUnity.GameEvent("turn"); ge.setParameter("mover", Entity.mover); ge.setParameter("direction", toLook); IsoUnity.Game.main.enqueueEvent(ge); } actionCell = null; actionEntity = null; } } if (!registered) { IsoUnity.ControllerManager.onControllerEvent += this.onControllerEvent; registered = true; } }
public override void eventHappened(IsoUnity.IGameEvent ge) { // If we're waiting for the event finished if (movement != null) { if (ge.Name.ToLower() == "event finished") { // Let's check it's our event: if (ge.getParameter("event") == movement) { // Ok it's done movement = null; } } } }
public override void ReceiveEvent(IsoUnity.IGameEvent ge) { base.ReceiveEvent(ge); }