Beispiel #1
0
 public override void CallEvent(EventSwitch eventSwitch)
 {
     if (nightmatrix && eventSwitch)
     {
         nightmatrix.InvertDirection();
         StartCoroutine(LockAndUnlockLoop(eventSwitch));
     }
 }
Beispiel #2
0
        public static void SetEventSwitch(int id, EventSwitch eventSwitch)
        {
            if (!_eventSwitches.ContainsKey(id))
            {
                _eventSwitches.Add(id, eventSwitch);
                return;
            }

            _eventSwitches[id] = eventSwitch;
        }
Beispiel #3
0
    private IEnumerator LockAndUnlockLoop(EventSwitch eventSwitch)
    {
        eventSwitch.Lock();
        yield return(new WaitForFixedUpdate());

        yield return(new WaitForFixedUpdate());

        yield return(new WaitForFixedUpdate());

        eventSwitch.Unlock();
    }
Beispiel #4
0
    public override void CallEvent(EventSwitch eventSwitch)
    {
        if (locked)
        {
            return;
        }
        locked = true;

        this.eventSwitch = eventSwitch;

        StopAllCoroutines();
        StartCoroutine(MoveTo(targetPosition));
    }
Beispiel #5
0
    public override void CallEvent(EventSwitch eventSwitch)
    {
        if (locked)
        {
            return;
        }
        locked = true;

        this.eventSwitch = eventSwitch;

        StopAllCoroutines();
        StartCoroutine(MoveTo(targetPosition));
        targetPosition = (targetPosition == startingPosition) ? (startingPosition + positionOffset) : startingPosition;
    }
Beispiel #6
0
 public virtual void CallEvent(EventSwitch eventSwitch)
 {
     Debug.Log("Event not overrided.");
 }