Beispiel #1
0
    public override void Update()
    {
        base.Update();
        if (isPlaced)
        {
            //Test
            if (Input.GetKeyDown(KeyCode.Z))
            {
                Charge.ChargeLevelChange(5);
                Debug.Log("Charge");
            }

            if (Charge.CurrentCharge == 0)
            {
                return;
            }

            //Turret Behvaiours
            CalculateAttackSpeed();
            CheckRadius();
            if (targetToAttack != null)
            {
                LookAtTarget();
                if (!isAttacking)
                {
                    StartCoroutine(TryAttack());
                }
            }
        }
    }
    public override void Update()
    {
        base.Update();
        if (!isPlaced)
        {
            //RotateVisualLookAt ();
        }

        if (isPlaced)
        {
            //Test
            if (Input.GetKeyDown(KeyCode.Z))
            {
                Charge.ChargeLevelChange(5);
            }

            //Turret Behvaiours
            DrainCharge();
        }
    }
 void DrainCharge()
 {
     Charge.ChargeLevelChange(-2 * Time.deltaTime);
 }