private void OnTriggerEnter(Collider other) { if (other.CompareTag("Powerup")) { PowerupEvent.Invoke(); } }
public void ApplyTo(PowerupManager car) { if (attached) { return; } attached = true; PowerupAttachable pAttachable = GetComponent <PowerupAttachable>(); PowerupEvent pEvent = GetComponent <PowerupEvent>(); PowerupBoost pBoost = GetComponent <PowerupBoost>(); PowerupStats pStats = GetComponent <PowerupStats>(); if (pAttachable != null) { appliedManager = car.Attach(pAttachable, pAttachable.attachType); } else if (pEvent != null) { appliedManager = car.AddEvent(pEvent); } else if (pBoost != null) { appliedManager = car.ApplyBoost(pBoost); } }
public void Reset() { Controller = GetComponent <HedgehogController>(); MoveManager = GetComponent <MoveManager>(); OnAdd = new PowerupEvent(); OnRemove = new PowerupEvent(); }
public void Awake() { Controller = Controller ?? GetComponent <HedgehogController>(); MoveManager = GetComponent <MoveManager>(); Powerups = new List <Powerup>(); OnAdd = OnAdd ?? new PowerupEvent(); OnRemove = OnRemove ?? new PowerupEvent(); }
public PowerupManager AddEvent(PowerupEvent pEvent) { //TODO: Do something return(this); }