public bool isTeleport; //Se esse objeto é um teleport private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") //colisao com player { GameModeSystem tempGMS = other.GetComponentInChildren <GameModeSystem>(); if (tempGMS.AtualCheck == ID_ToCheck && isTeleport == false) {//Verifica se já completamos a lista de check e se somos um teleport return; } if (isTeleport) // se for um teleport, iremos pro proximo { tempGMS.Teleport(); //Vamos para o proximo nó NextCheck.SetActive(true); //iremos reativar o check1, para caso repetirmos esse nó this.gameObject.SetActive(false); //após colidir, vai ficar desativado return; } tempGMS.GetCheck(ID_ToCheck, reff); //iremos pro proximo check desse nó NextCheck.SetActive(true); this.gameObject.SetActive(false); //Esse check é desativado } }
private void Start() { PV = GetComponent <PhotonView>(); m_character = GetComponent <ThirdPersonCharacter>(); m_control = GetComponent <ThirdPersonUserControl>(); GMS = GetComponentInChildren <GameModeSystem>(); if (PV.IsMine) { Interface_UI_3.SetActive(true); PhotonID_User = PV.ViewID; PV.RPC("SetName", RpcTarget.All); } else { GMS.enabled = false; } }