public override void Start() { base.Start(); cam = transform.parent.gameObject.transform.GetChild(0).gameObject; playerThings = GetComponent <PlayerThings>(); dogController = GetComponent <DogController>(); hitCarro = Resources.Load <BoolVariable>("HitCarro"); hitPipa = Resources.Load <BoolVariable>("HitPipa"); isCaixaDaguaSound = true; isBallKicked = true; isShotRecived = true; motoSpd = GetComponent <MotoChangeSpeed>(); if (isVolei) { handVolei = GetComponent <HandVolei>(); } if (isFut) { futebolPlayer = GetComponent <FutebolPlayer>(); } }
void Awake() { if (Instance == null) { DontDestroyOnLoad(gameObject); Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
void Start() { PV = GetComponent <PhotonView>(); int spawnPicker; spawnPicker = PhotonNetwork.IsMasterClient.Equals(true) ? 0 : 1; //achar posição de spawn(primeiro ou segundo player) //int spawnPicker = Random.Range(0, GameSetupController.GS.spawnPoints.Length); string prefabName = GameSetupController.GS.playerPrefabName; if (PV.IsMine || !PhotonNetwork.InRoom) { myAvatar = PhotonNetwork.Instantiate(Path.Combine("PhotonPrefabs", prefabName), GameSetupController.GS.spawnPoints[spawnPicker].position, GameSetupController.GS.spawnPoints[spawnPicker].rotation, 0); myPlayer = myAvatar; SceneInitializer.current.GetPlayerPositionInGame(); } playerMove = myAvatar.GetComponentInChildren <NewPlayerMovent>(); motoPlayerMovement = myAvatar.GetComponentInChildren <NewMotoPlayerMovement>(); playerThings = myAvatar.GetComponentInChildren <PlayerThings>(); if (playerMove != null) { playerMove.enabled = false; } if (motoPlayerMovement != null) { motoPlayerMovement.enabled = false; } }