public void LevelReset() { timer += Time.deltaTime; if (timer >= resetAfterDeathTime) { fader.EndScene(); } }
//ほかのシーンを読み込む public void LeverReset() { timer += Time.deltaTime; if (timer >= resetAfterDeathTine) { fader.EndScene(); // シーンをリセット } }
public void LevelReset() //关卡重置 { timer += Time.deltaTime; //计时器 colorCurves.saturation -= (Time.deltaTime / 2); //逐渐变为黑白的效果 colorCurves.saturation = Mathf.Max(0, colorCurves.saturation); //保证值大于0 if (timer >= resetAfterDeathTime) //如果超过了死亡等待时间 { fader.EndScene(); //重新加载场景的方法 } }
public void LevelReset() { timer += Time.deltaTime; colorCurves.saturation -= (Time.deltaTime / 2); colorCurves.saturation = Mathf.Max(0, colorCurves.saturation); if (timer >= resetAfterDeathTime) { fader.EndScene(); } }
private void InExitActivation() { timer += Time.deltaTime; if (timer >= timeToInactivePlayer) { player.GetComponent <fps_PlayerHealth>().DisableInput(); } if (timer >= timeToRestart) { fader.EndScene(); } }
private void InExitActivation() //出口被激活时 { timer += Time.deltaTime; //开始计时 if (timer >= timeToInactivePlayer) //出口已被触发 { player.GetComponent <fps_PlayerHealth>().DisableInput(); //禁用用户的输入 } if (timer >= timeToRestart) //重新开始游戏被触发 { fader.EndScene(); //重新加载场景 } }
void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { if (entranceName == "InsideCafeteriaBuilding") { if (Managers.Player != null && entranceName != Managers.Player.GetPreviousRoomName()) { Managers.Player.SetPreviousRoomName(SceneManager.GetActiveScene().name); Managers.Player.SetEnteringRoomName(entranceName); Debug.Log("On door trigger enter: " + entranceName); fadeScr.EndScene(scene); } else { Debug.Log("On door trigger enter: " + entranceName); } } else if (entranceName == "ArtHallway") { if (Managers.Player != null && entranceName != Managers.Player.GetPreviousRoomName()) { Managers.Player.SetPreviousRoomName(SceneManager.GetActiveScene().name); Managers.Player.SetEnteringRoomName(entranceName); Debug.Log("On door trigger enter: " + entranceName); fadeScr.EndScene(scene); } else { Debug.Log("On door trigger enter: " + entranceName); } } else if (entranceName == "ScienceHallway") { if (Managers.Player != null && entranceName != Managers.Player.GetPreviousRoomName()) { Managers.Player.SetPreviousRoomName(SceneManager.GetActiveScene().name); Managers.Player.SetEnteringRoomName(entranceName); Debug.Log("On door trigger enter: " + entranceName); fadeScr.EndScene(scene); } else { Debug.Log("On door trigger enter: " + entranceName); } } else if (entranceName == "ArtRoom") { if (Managers.Player != null && entranceName != Managers.Player.GetPreviousRoomName()) { Managers.Player.SetPreviousRoomName(SceneManager.GetActiveScene().name); Managers.Player.SetEnteringRoomName(entranceName); Debug.Log("On door trigger enter: " + entranceName); fadeScr.EndScene(scene); } else { Debug.Log("On door trigger enter: " + entranceName); } } else if (entranceName == "TerrainCampus") { if (Managers.Inventory != null) { Debug.Log(Managers.Inventory.GetItemCount("Phone")); if (Managers.Inventory.GetItemCount("Phone") > 0) { if (Managers.Player != null && entranceName != Managers.Player.GetPreviousRoomName()) { Managers.Player.SetPreviousRoomName(SceneManager.GetActiveScene().name); Managers.Player.SetEnteringRoomName(entranceName); Debug.Log("On door trigger enter: " + entranceName); fadeScr.EndScene(scene); } else { Debug.Log("On door trigger enter: " + entranceName); } } else { doorFeedback.enabled = true; dialogueFeedback.enabled = true; dialogueFeedback.GetComponent <Animator>().SetTrigger("Display"); audioSource.PlayOneShot(audioClip); } } } else if (entranceName == "Dorm") { if (Managers.Player != null && entranceName != Managers.Player.GetPreviousRoomName()) { Managers.Player.SetPreviousRoomName(SceneManager.GetActiveScene().name); Managers.Player.SetEnteringRoomName(entranceName); Debug.Log("On door trigger enter: " + entranceName); fadeScr.EndScene(scene); } else { Debug.Log("On door trigger enter: " + entranceName); } } } }