Пример #1
0
 // Update is called once per frame
 void Update()
 {
     if (engineDriverStack != null && !gameFinished)
     {
         float engineForce = engineDriverStack.GetHead().GetForce();
         PlaySoundEngine(engineForce);
     }
 }
Пример #2
0
    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);
            }
        }
    }
Пример #3
0
    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);
                }
            }
        }
    }
Пример #4
0
 // Update is called once per frame
 void Update()
 {
     engineDriverStack.GetHead().Update(inputProxy.Acceleration);
     wheelDriverStack.GetHead().Update();
 }