void playShootSoundRPC(PhotonMessageInfo pmi) { Player player = Player.FindPlayer(pmi.sender); PlayerGO playerGO = player.gameObject.GetComponent <PlayerGO>(); playerGO.weaponShootSoundAS.Stop(); /* Transform al = CamerasManager.cameras[CameraEnum.sceneCamera].transform; * * if (Player.myPlayer.gameObject != null) * al = Player.myPlayer.gameObject.transform;*/ playerGO.weaponShootSoundAS.PlayOneShot(weaponsShootSounds[playerGO.GetComponent <WeaponsManager>().activeWeapon.weapon.Enum]); }
private void Awake() { if (instance != null) { Debug.LogWarning("More than one instance of PlayerManager found !"); return; } instance = this; PlayerController = PlayerGO.GetComponent <PlayerController>(); PlayerCombat = PlayerGO.GetComponent <CharacterCombat>(); //PlayerStats = PlayerGO.GetComponent<PlayerStats>(); PlayerAnimator = PlayerGO.GetComponent <PlayerAnimator>(); PlayerLevel = PlayerGO.GetComponent <PlayerLevel>(); PlayerFocus = PlayerGO.GetComponent <PlayerFocus>(); Player = PlayerGO.GetComponent <Player>(); }