public override void ExecuteAttack(Spaceship attacker, bool hasTarget, int targetUID, Vector2 position, Vector2 direction, Vector2 initialVelocity) { if (AttackManager == null) { AttackManager = new LaserAttackManager(attacker, Range, Damage); } AttackManager.TurnOn(direction, hasTarget, targetUID); }
public void Initialize(LaserAttackManager manager, float range) { Manager = manager; StopWatch = 0f; Spaceships = new List <Spaceship>(); Active = false; LaserTip = Instantiate(GeneralPrefabs.Instance.LaserTip, Vector2.zero, Quaternion.identity); LaserTip.transform.SetParent(transform); LaserTip.transform.localPosition = new Vector2(1, 0); LaserTip.transform.localRotation = Quaternion.identity; LaserTip.transform.localScale = new Vector2(Manager.BEAM_WIDTH / range, 1); }