private void Awake() { // get the car controller m_Car = GetComponent <CarController>(); turboDash = GetComponent <TurboDash>(); carPower = GetComponent <PowerInventory>(); }
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(); }
void OnTriggerEnter(Collider other) { if (other.gameObject.layer == LayerMask.NameToLayer("Player") && !hasBeenPickedUp) { PowerInventory otherPowerInventory = other.GetComponentInParent <PowerInventory>(); hasBeenPickedUp = otherPowerInventory.TryEquipPowerUp(this); } }
virtual public void Activate(PowerInventory caller) { }