Beispiel #1
0
    public LaserAttackManager(Spaceship attacker, float range, float damage)
    {
        Attacker         = attacker;
        Damage           = damage;
        ImmunityDuration = IMMUNITY_DURATION;

        GameObject gameObject = GameManager.Instance.Instantiate(GeneralPrefabs.Instance.LaserBeam, Vector2.zero, Quaternion.identity);

        gameObject.transform.SetParent(attacker.transform);
        gameObject.transform.localPosition = Vector2.zero;
        gameObject.transform.localRotation = Quaternion.identity;
        gameObject.transform.localScale    = new Vector2(range, BEAM_WIDTH) / attacker.transform.localScale.x;
        Laser = gameObject.GetComponent <LaserController>();
        Laser.Initialize(this, range);
        TurnOff();
    }