private void Start() { GameMusicPlayer.killMusic(); Screen.orientation = ScreenOrientation.LandscapeLeft; win = 25; lose = -25; getScore(); if (PhotonNetwork.player.IsMasterClient) { t1 = PhotonNetwork.Instantiate("Tower1", new Vector2(-4.16f, 0.3f), Quaternion.identity, 0); t2 = PhotonNetwork.Instantiate("Tower2", new Vector2(4.16f, 0.3f), Quaternion.identity, 0); t1.name = "Tower1"; t2.GetComponent <PhotonView>().TransferOwnership(PhotonNetwork.otherPlayers[0]); t2.name = "Tower2"; } player1text.text = PhotonNetwork.playerList[1].NickName; //hamit,bug player2text.text = PhotonNetwork.playerList[0].NickName; p1.text = PhotonNetwork.masterClient.NickName; if (PhotonNetwork.player.IsMasterClient) { p2.text = PhotonNetwork.otherPlayers[0].NickName; } else { p2.text = PhotonNetwork.player.NickName; } }
// Use this for initialization void Start() { gameMusicPlayer = GameObject.Find("GameMusicPlayer"); gameMusicPlayerClass = gameMusicPlayer.GetComponent <GameMusicPlayer>(); friendAudio = GameObject.Find("FriendAudio").GetComponent <AudioSource>(); energyAudio = GameObject.Find("EnergyAudio").GetComponent <AudioSource>(); enemyAudio = GameObject.Find("EnemyAudio").GetComponent <AudioSource>(); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(gameObject); return; } _instance = this; DontDestroyOnLoad(gameObject); }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
// Update is called once per frame void Update() { GameMusicPlayer musicPlayer = FindObjectOfType <GameMusicPlayer>(); if (musicPlayer) { musicPlayer.SetVolume(volumeSlider.value); } else { Debug.LogWarning("No music player found."); } }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(transform.gameObject); _audioSource = GetComponent <AudioSource>(); }
public void goBackToMenu() { PhotonNetwork.Disconnect(); SceneManager.LoadScene(1); GameMusicPlayer.startMusic(); }