public IEnumerator A0_InstantiatePlayer_Enumerator() { GameObject launcher = new GameObject(); launcher.name = "Launcher"; launcher.AddComponent <Launcher>(); launcher.GetComponent <Launcher>().SetTesting(true); //ensures loading straight to TankGame scene PhotonNetwork.ConnectUsingSettings(); //waits 5 seconds before creating a room yield return(new WaitForSeconds(5f)); PhotonNetwork.CreateRoom("test"); //wait 5 sendons before spawning a player in yield return(new WaitForSeconds(8f)); Vector3 pos = new Vector3(-8.44f, 0.5f, 3.4f); Quaternion rot = new Quaternion(0f, 0f, 0f, 0f); this.player = GameObject.FindGameObjectWithTag("Player"); this.player.transform.position = pos; this.player.transform.rotation = rot; this.playerManagerstats = this.player.GetComponent <PlayerManager>(); //assigns the player manager component of the new player this.playerPowerups = this.player.GetComponent <PlayerPowerupManager>(); Assert.IsNotNull(this.player); }
// Use this for initialization void Start() { mPlayerPowerups = this.GetComponent<PlayerPowerupManager>(); mPlayerFire = this.GetComponent<PlayerFireManager>(); mPlayerMovement = this.GetComponent<Player2AxisMovement>(); Global.Health(mPlayerID, 1, true); }