Beispiel #1
0
    public void Init(int id, GameConstants.PlayerKeys keys, PlayerInformation playerInformation)
    {
        this.Id = id;
        SetPlayerKeys(keys);
        this.PlayerInformation = playerInformation;

        GameObject go = Instantiate(playerInformation.PlayerShipPrefab, _shipContainer, false) as GameObject;

        _playerShip = go.GetComponent <SpaceShipController> ();
        _playerShip.Init(this);

        _playerShip.OnTriggerEnterAsObservable().Subscribe(collider => {
            OnPlayerShipTriggerEnter(collider);
        });
    }