Exemple #1
0
 private void Awake()
 {
     if (isLocalPlayer)
     {
         instance = this;
     }
 }
Exemple #2
0
	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;
	}
Exemple #3
0
    public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer)
    {
        LobbyPlayer        lPlayer = lobbyPlayer.GetComponent <LobbyPlayer>();
        PlayerNetworkSetup gPlayer = gamePlayer.GetComponent <PlayerNetworkSetup>();

        gPlayer.name = lPlayer.name;
    }
Exemple #4
0
 void SyncPositionValues(Vector3 latestPos)
 {
     syncPos = latestPos;
     if (!PlayerNetworkSetup.IsLocal())
     {
         syncPosList.Add(syncPos);
     }
 }
Exemple #5
0
 void LerpPosition()
 {
     if (!PlayerNetworkSetup.IsLocal())
     {
         if (useHistoricLerping)
         {
             HistoricalLerping();
         }
         else
         {
             OrdinaryLerping();
         }
     }
 }
Exemple #6
0
 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();
         }
     }
 }
Exemple #7
0
    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);
                }
            }
        }
    }