Пример #1
0
 private void Awake()
 {
     // get the car controller
     m_Car     = GetComponent <CarController>();
     turboDash = GetComponent <TurboDash>();
     carPower  = GetComponent <PowerInventory>();
 }
Пример #2
0
    public override void Activate(PowerInventory caller)
    {
        //we instantiate a projectile in front of the car, the projectile goes at constant speed in a direction
        GameObject missile = GameObject.Instantiate(PrefabManager.Instance.prefabMissile);

        missile.GetComponent <MissileBehavior>().sender = caller.gameObject;
        missile.GetComponent <MissileBehavior>().Launch();
    }
Пример #3
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.layer == LayerMask.NameToLayer("Player") && !hasBeenPickedUp)
     {
         PowerInventory otherPowerInventory = other.GetComponentInParent <PowerInventory>();
         hasBeenPickedUp = otherPowerInventory.TryEquipPowerUp(this);
     }
 }
Пример #4
0
 virtual public void Activate(PowerInventory caller)
 {
 }