예제 #1
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);
        }
    }