Ejemplo n.º 1
0
    public void EnableScript(int room)
    {
        switch (room)
        {
        case 0:
            nextPhase.SetPersistentListenerState(0, UnityEventCallState.RuntimeOnly);
            nextPhase.SetPersistentListenerState(1, UnityEventCallState.Off);
            nextPhase.SetPersistentListenerState(2, UnityEventCallState.Off);
            nextPhase.SetPersistentListenerState(3, UnityEventCallState.Off);
            this.gameObject.GetComponent <RoomZero>().enabled = true;
            this.gameObject.GetComponent <RoomA>().enabled    = false;
            this.gameObject.GetComponent <RoomB>().enabled    = false;
            this.gameObject.GetComponent <RoomC>().enabled    = false;
            break;

        case 1:
            nextPhase.SetPersistentListenerState(0, UnityEventCallState.Off);
            nextPhase.SetPersistentListenerState(1, UnityEventCallState.RuntimeOnly);
            nextPhase.SetPersistentListenerState(2, UnityEventCallState.Off);
            nextPhase.SetPersistentListenerState(3, UnityEventCallState.Off);
            this.gameObject.GetComponent <RoomZero>().enabled = false;
            this.gameObject.GetComponent <RoomA>().enabled    = true;
            this.gameObject.GetComponent <RoomB>().enabled    = false;
            this.gameObject.GetComponent <RoomC>().enabled    = false;
            break;

        case 2:
            nextPhase.SetPersistentListenerState(0, UnityEventCallState.Off);
            nextPhase.SetPersistentListenerState(1, UnityEventCallState.Off);
            nextPhase.SetPersistentListenerState(2, UnityEventCallState.RuntimeOnly);
            nextPhase.SetPersistentListenerState(3, UnityEventCallState.Off);
            this.gameObject.GetComponent <RoomZero>().enabled = false;
            this.gameObject.GetComponent <RoomA>().enabled    = false;
            this.gameObject.GetComponent <RoomB>().enabled    = true;
            this.gameObject.GetComponent <RoomC>().enabled    = false;
            break;

        case 3:
            nextPhase.SetPersistentListenerState(0, UnityEventCallState.Off);
            nextPhase.SetPersistentListenerState(1, UnityEventCallState.Off);
            nextPhase.SetPersistentListenerState(2, UnityEventCallState.Off);
            nextPhase.SetPersistentListenerState(3, UnityEventCallState.RuntimeOnly);
            this.gameObject.GetComponent <RoomZero>().enabled = false;
            this.gameObject.GetComponent <RoomA>().enabled    = false;
            this.gameObject.GetComponent <RoomB>().enabled    = false;
            this.gameObject.GetComponent <RoomC>().enabled    = true;
            break;

        default:
            nextPhase.SetPersistentListenerState(0, UnityEventCallState.Off);
            nextPhase.SetPersistentListenerState(1, UnityEventCallState.Off);
            nextPhase.SetPersistentListenerState(2, UnityEventCallState.Off);
            this.gameObject.GetComponent <RoomZero>().enabled = false;
            this.gameObject.GetComponent <RoomA>().enabled    = false;
            this.gameObject.GetComponent <RoomB>().enabled    = false;
            break;
        }
    }