private void animLaserFire() { switch (attackAnimationState) { case AttackAnimationState.NeedsToStart: LaserFire.Play(); playSound(LaserFireSound); attackAnimationState = AttackAnimationState.InProgress; break; case AttackAnimationState.InProgress: LaserFire.transform.Rotate(new Vector3(0, 0, 10) * Time.deltaTime); if (LaserFire.transform.rotation.eulerAngles.z > 9 && LaserFire.transform.rotation.eulerAngles.z < 10) { LaserFire.Stop(); LaserFire.Clear(); LaserFire.transform.localRotation = initialLaserRot; currentAnimation = AnimationSequence.None; attackAnimationState = AttackAnimationState.Off; //EVERYONE DIES HAHAHAHAHAHAH targets.ForEach(t => t.Damage(AttackPower)); AnimationInProgress = false; } break; } }
private void animLaserCharge() { switch (attackAnimationState) { case AttackAnimationState.NeedsToStart: LaserCharge.Play(); attackAnimationState = AttackAnimationState.InProgress; playSound(LaserChargeSound); break; case AttackAnimationState.InProgress: if (LaserCharge.time >= 2.5) { currentAnimation = AnimationSequence.LaserFire; attackAnimationState = AttackAnimationState.NeedsToStart; LaserFire.Stop(); } break; } }