Ejemplo n.º 1
0
        // Player attacks without a specific target
        public void Attack()
        {
            if (!GetComponent <Energy>().CanConsumeEnergy(currentWeaponConfig.GetEnergyToAttack()))
            {
                return;
            }

            StartCoroutine(GetComponent <Mover>().RotateAsynchronously(Camera.main.transform.forward));
            GetComponent <ActionScheduler>().StartAction(this);
            if (!isAnAttackQueued())
            {
                GetComponent <Energy>().ConsumeEnergy(currentWeaponConfig.GetEnergyToAttack());
            }
            TriggerAttackAnimation();
        }