//void OnTriggerStay(Collider collEnter) //{ // if (collEnter.gameObject.tag == "Player") // { // //playerComand.checkpoint = transform.parent; // if (playerComand.playerLife <= healthBarPlayer.getMaxPoints()) // { // //print("GANHANDO VIDA"); // //playerComand.playerLife += lifeHealVal; // //healthBarPlayer.HealDamage(lifeHealVal); // } // } //} void OnTriggerEnter(Collider collEnter2) { if (collEnter2.gameObject.tag == "Player") { savedGame = true; //print("nFase:" + numFase); playerComand.x = transform.position.x; playerComand.y = transform.position.y; playerComand.z = transform.position.z; saveLoad.loadPos_x = transform.position.x; saveLoad.loadPos_y = transform.position.y; saveLoad.loadPos_z = transform.position.z; saveLoad.WriteText("SaveGame"); // se o valor do save for maior ou igual ao valor do savepoint, ele fica true if (savedTrigger == false && savedTrigger == false) { if (saveLoad.saveLightQuadrant <= numQuadrant) { saveLoad.saveLightQuadrant = numQuadrant; //} for (int i = 0; i < numQuadrant; i++) { for (int j = 0; j < lightQuadrant[i].gameObject.transform.childCount; j++) { //lightQuadrant[i].gameObject.transform.GetChild(j).gameObject. //GetComponent<Renderer>().enabled = true; lightQuadrant[i].gameObject.transform.GetChild(j).gameObject.SetActive(true); } //lightQuadrant[i].gameObject. //lightQuadrant[i].gameObject.transform.GetChild(1).gameObject.SetActive(true); //GetComponentInChildren<GameObject>().SetActive(true); //lightQuadrant[i].GetComponent<Renderer>().enabled = false; } } } savedTrigger = true; } }