Esempio n. 1
0
    void Die(DeathType type)
    {
        var rb = GetComponent <Rigidbody>();

        rb.constraints = RigidbodyConstraints.None;
        _state         = PlayerState.Dying;
        enabled        = false;
        HighwayManagement.OnPlayerDie(type);
        _onDie.Invoke();
    }
Esempio n. 2
0
 public void PlayerEnteredRoad()
 {
     if (Active != this)
     {
         Active = this;
         HighwayManagement.SpawnRoundabout();
         _activeSpawnPoint = null;
         _despawn2.gameObject.SetActive(false);
     }
 }
Esempio n. 3
0
 void Awake()
 {
     if (_i)
     {
         Destroy(gameObject);
     }
     else
     {
         _i     = this;
         _lives = _startingLives;
     }
 }
Esempio n. 4
0
    IEnumerator Start()
    {
        yield return(new WaitForSeconds(HighwayManagement.UiAppearTime));

        HighwayManagement.ActivateLives();
    }
Esempio n. 5
0
 protected override void OnPickedUp(Player p)
 {
     HighwayManagement.AddLives(_value);
 }
Esempio n. 6
0
 public void OnPickup(Player p)
 {
     OnPickedUp(p);
     Destroy(gameObject);
     HighwayManagement.OnPickup(this);
 }