private void Awake() { if (isLocalPlayer) { instance = this; } }
public override void OnStartClient() { // runs every time a new client is built player_network_setup = GetComponent<PlayerNetworkSetup>(); player_info = player_manager.GetComponent<PlayerInfo>(); player_input = player_manager.GetComponent<PlayerInput>(); player = player_info.player; beacon = player_info.beacon; }
public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer) { LobbyPlayer lPlayer = lobbyPlayer.GetComponent <LobbyPlayer>(); PlayerNetworkSetup gPlayer = gamePlayer.GetComponent <PlayerNetworkSetup>(); gPlayer.name = lPlayer.name; }
void SyncPositionValues(Vector3 latestPos) { syncPos = latestPos; if (!PlayerNetworkSetup.IsLocal()) { syncPosList.Add(syncPos); } }
void LerpPosition() { if (!PlayerNetworkSetup.IsLocal()) { if (useHistoricLerping) { HistoricalLerping(); } else { OrdinaryLerping(); } } }
void LerpRotations() { //playerTransform.rotation = Quaternion.Lerp(playerTransform.rotation, syncPlayerRotation, Time.deltaTime * lerpRate); //camTransform.rotation = Quaternion.Lerp(camTransform.rotation, syncCamRotation, Time.deltaTime * lerpRate); if (!PlayerNetworkSetup.IsLocal()) { if (useHistoricalInterpolation) { HistoricalInterpolation(); } else { OrdinaryLerping(); } } }
private void Start() { DontDestroyOnLoad(gameObject); if (isLocalPlayer) { instance = this; } //GAP if (isLocalPlayer) { foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Player")) { if (obj.GetComponent <PlayerNetworkSetup>().gameStart) { CmdDeletePlayer(gameObject); } } } }