예제 #1
0
    public void OnSpawnPlayer(SpawnPlayerData spawnPlayerData)
    {
        Debug.Log("Got Player Spawn Data!");
        var player = _spawner.GetPlayerObject(spawnPlayerData);

        AddNewNetObject(player, spawnPlayerData.objectID);
        _playerList.Add(spawnPlayerData.owner, player);
        SendMessageToObjectWaitOneFrame(spawnPlayerData, spawnPlayerData.objectID,
                                        GetFunctionName(spawnPlayerData));
    }
예제 #2
0
    public GameObject GetPlayerObject(SpawnPlayerData playerData)
    {
        var player = baseSpawn(Player, playerData);
        var netOBJ = player.GetComponent <NetworkObject>();

        if (netOBJ != null)
        {
            netOBJ.SetIsOwner(playerData.IsOwner);
        }

        return(player);
    }
예제 #3
0
    public void PlayerSpawn(SpawnPlayerData spawnPlayerData)
    {
        this.speed = spawnPlayerData.speed;
        var tempHealthComp = GetComponent <HealthComponent>();

        healthComponent.Health    = spawnPlayerData.Health;
        healthComponent.MaxHealth = spawnPlayerData.MaxHealth;

        if (!_netObject.getIsOwner())
        {
            GetComponentInChildren <Camera>().enabled = false;
        }
    }
예제 #4
0
 public void OnSpawnPlayer(SpawnPlayerData spawnPlayerData)
 {
 }