void Die(DeathType type) { var rb = GetComponent <Rigidbody>(); rb.constraints = RigidbodyConstraints.None; _state = PlayerState.Dying; enabled = false; HighwayManagement.OnPlayerDie(type); _onDie.Invoke(); }
public void PlayerEnteredRoad() { if (Active != this) { Active = this; HighwayManagement.SpawnRoundabout(); _activeSpawnPoint = null; _despawn2.gameObject.SetActive(false); } }
void Awake() { if (_i) { Destroy(gameObject); } else { _i = this; _lives = _startingLives; } }
IEnumerator Start() { yield return(new WaitForSeconds(HighwayManagement.UiAppearTime)); HighwayManagement.ActivateLives(); }
protected override void OnPickedUp(Player p) { HighwayManagement.AddLives(_value); }
public void OnPickup(Player p) { OnPickedUp(p); Destroy(gameObject); HighwayManagement.OnPickup(this); }