// Update is called once per frame void Update() { if (engineDriverStack != null && !gameFinished) { float engineForce = engineDriverStack.GetHead().GetForce(); PlaySoundEngine(engineForce); } }
void OnProximityEnter(object sender, Collider other) { GameObject collidedObj = other.gameObject; if (collidedObj.tag == Tags.Orb) { OrbController orbController = collidedObj.GetComponent <OrbController>(); if (!orbController.IsAttached()) { attacherDriverStack.GetHead().AttachOrbs(collidedObj, Tail); } } }
void OnCollisionEnter(Collision collision) { GameObject collidedObj = collision.gameObject; if (collidedObj.tag == Tags.Ship) { if (IsAttack(collidedObj)) { float damage = collidedObj.GetComponent <TailController>().GetOffenceDriverStack().GetHead().GetDamage(this.gameObject, collision); int nOrbsToDetach = defenceDriverStack.GetHead().DamageToOrbs(damage); List <GameObject> orbsDetached = detacherDriverStack.GetHead().DetachOrbs(nOrbsToDetach, this.Tail); if (OnEventFight != null) { OnEventFight(this, orbsDetached, collidedObj, this.gameObject); } } } }
// Update is called once per frame void Update() { engineDriverStack.GetHead().Update(inputProxy.Acceleration); wheelDriverStack.GetHead().Update(); }