public override void Acao() { //Criogenia.lastLever = this; if (isActive) { Debug.Log("Click"); //isActive = false; currentState = !currentState; if (currentState) { this.gameObject.GetComponent <SpriteRenderer>().color = Color.green; } else { this.gameObject.GetComponent <SpriteRenderer>().color = Color.red; } Criogenia.CheckWinCondition(); if (index == 1) { Criogenia.SwapRoomTemp(2); } else if (index == 2) { Criogenia.SwapRoomTemp(1); } } }
void Update() { if (Input.GetKeyDown(KeyCode.H)) { Criogenia.SwapRoomTemp(1); } if (Input.GetKeyDown(KeyCode.B)) { Criogenia.SwapRoomTemp(2); } }
public override void Acao() { //Criogenia.lastLever = this; if (isActive) { Debug.Log("Click"); //isActive = false; currentState = !currentState; if (currentState) { this.gameObject.GetComponent <SpriteRenderer>().color = Color.green; } else { this.gameObject.GetComponent <SpriteRenderer>().color = Color.red; } Criogenia.CheckWinCondition(); if (index == 1) { Criogenia.SwapRoomTemp(2); } else if (index == 2) { Criogenia.SwapRoomTemp(1); } foreach (var player in FindObjectsOfType <Movimento_Player>()) { Debug.Log(player.gameObject.name + "Found"); if (player.playerIndex != index) { player.isInControl = true; } } } }