public void FinishMission(Constants.Mission mission) { nextMission = mission + 1; if (nextMission >= Constants.Mission.Mission1_2F) { NetworkChangeScene.AllPlayerChangeScene("BaseNew"); } //StartMission(); }
public void FailMission() { Debug.Log("Just failed mission " + nextMission); justFailed = true; StopMission(); NetworkChangeScene.AllPlayerChangeScene("BaseNew"); GameObject.Find("Player1Character").GetComponent <ControlScript>().health = 60; GameObject.Find("Player2Character").GetComponent <ControlScript>().health = 60; }
IEnumerator _FailMission() { UnityEngine.UI.Image blackScreen = GameObject.Find("Death").GetComponent <UnityEngine.UI.Image>(); blackScreen.color = Color.black; blackScreen.canvasRenderer.SetAlpha(0.0f); blackScreen.CrossFadeAlpha(1.0f, 3, false); yield return(new WaitForSeconds(3)); NetworkChangeScene.AllPlayerChangeScene("BaseNew"); GameObject.Find("Player1Character").GetComponent <ControlScript>().health = 60; GameObject.Find("Player2Character").GetComponent <ControlScript>().health = 60; yield break; }
// Update is called once per frame void Update() { photonView.RPC("ForceUpdate", PhotonTargets.All, nextMission, mission2, justFailed); if (justFailed) { justFailed = false; //StartCoroutine(_FailMission()); NetworkChangeScene.AllPlayerChangeScene("BaseNew"); GameObject.Find("Player1Character").GetComponent <ControlScript>().health = 60; GameObject.Find("Player2Character").GetComponent <ControlScript>().health = 60; } if (PhotonNetwork.isMasterClient) { switch (nextMission) { case Constants.Mission.Stage2_1F: bool waveDone = npcManager.AllDead(); if (waveDone /* && mission2.nextWave == 2*/) { FinishMission(); break; } //if (waveDone) //{ //mission2.nextWave++; //GameObject[] enemySpawnPoints = GameObject.FindGameObjectsWithTag("EnemySpawnPoint"); //npcManager.Spawn("Orc_Gnur", enemySpawnPoints[2]); //npcManager.Spawn("Orc_Gnur", enemySpawnPoints[3]); //npcManager.Spawn("Orc_Gnur", enemySpawnPoints[4]); //} break; } } }
public void FinishMission() { nextMission += 1; NetworkChangeScene.AllPlayerChangeScene("BaseNew"); //StartMission(); }