public override void CallEvent(EventSwitch eventSwitch) { if (nightmatrix && eventSwitch) { nightmatrix.InvertDirection(); StartCoroutine(LockAndUnlockLoop(eventSwitch)); } }
public static void SetEventSwitch(int id, EventSwitch eventSwitch) { if (!_eventSwitches.ContainsKey(id)) { _eventSwitches.Add(id, eventSwitch); return; } _eventSwitches[id] = eventSwitch; }
private IEnumerator LockAndUnlockLoop(EventSwitch eventSwitch) { eventSwitch.Lock(); yield return(new WaitForFixedUpdate()); yield return(new WaitForFixedUpdate()); yield return(new WaitForFixedUpdate()); eventSwitch.Unlock(); }
public override void CallEvent(EventSwitch eventSwitch) { if (locked) { return; } locked = true; this.eventSwitch = eventSwitch; StopAllCoroutines(); StartCoroutine(MoveTo(targetPosition)); }
public override void CallEvent(EventSwitch eventSwitch) { if (locked) { return; } locked = true; this.eventSwitch = eventSwitch; StopAllCoroutines(); StartCoroutine(MoveTo(targetPosition)); targetPosition = (targetPosition == startingPosition) ? (startingPosition + positionOffset) : startingPosition; }
public virtual void CallEvent(EventSwitch eventSwitch) { Debug.Log("Event not overrided."); }