Esempio n. 1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Powerup"))
     {
         PowerupEvent.Invoke();
     }
 }
Esempio n. 2
0
    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);
        }
    }
Esempio n. 3
0
 public void Reset()
 {
     Controller  = GetComponent <HedgehogController>();
     MoveManager = GetComponent <MoveManager>();
     OnAdd       = new PowerupEvent();
     OnRemove    = new PowerupEvent();
 }
Esempio n. 4
0
 public void Awake()
 {
     Controller  = Controller ?? GetComponent <HedgehogController>();
     MoveManager = GetComponent <MoveManager>();
     Powerups    = new List <Powerup>();
     OnAdd       = OnAdd ?? new PowerupEvent();
     OnRemove    = OnRemove ?? new PowerupEvent();
 }
Esempio n. 5
0
 public PowerupManager AddEvent(PowerupEvent pEvent)
 {
     //TODO:  Do something
     return(this);
 }