Example #1
0
    public void AddPlayer(GameObject player)
    {
        NetworkPlayerInput playerInput = player.GetComponent <NetworkPlayerInput>();

        playerInput.SetGameManager(_gameManager);
        playerInput.SetEnergySpawner(_energySpawner);
        playerInput.SetPlayerId(_currentPlayerId);

        // Pass playerView to output w/ currentPlayerIndex
        _networkPlayerOutputController.AddNetworkPlayerView(player.GetComponent <NetworkPlayerView>());

        _networkPlayerInputs.Add(playerInput);

        _currentPlayerId++;
    }
    private void Start()
    {
        src = GetComponent <AudioSource>();
        if (!photonView.IsMine)
        {
            return;
        }
        CreateVaultHelper();
        playerInput = GetComponent <NetworkPlayerInput>();
        movement    = GetComponent <NetworkPlayerMovement>();

        if (GetComponentInChildren <AnimateLean>())
        {
            animateLean = GetComponentInChildren <AnimateLean>();
        }

        slideLimit  = movement.controller.slopeLimit - .1f;
        radius      = movement.controller.radius;
        height      = movement.controller.height;
        halfradius  = radius / 2f;
        halfheight  = height / 2f;
        rayDistance = halfheight + radius + .1f;
    }
 public void Start()
 {
     _ownerPlayerInput = GameObject.Find("Player " + _ownerId).GetComponent <NetworkPlayerInput>();
 }