Пример #1
0
    protected override void OnDisable()
    {
        base.OnDisable();
        ParentSkill.SkillSpriteRenderer.flipX = m_DefaultSpriteFlipX;

        if (ParentSkill.SkillOwner.CompareTag(BattleGlobals.TAG_FOR_ENEMIES))
        {
            ParentSkill.ToggleSpriteFlipX();
        }

        ParentSkill.SkillOwner.NPCRigidBody2D.velocity = Vector2.zero;
        ParentSkill.SkillOwner.ResetRigidBody2DRotation();

        MeleeCollider2D.enabled = false;
    }
    protected override void OnEnable()
    {
        base.OnEnable();

        m_WavesInFlight = 0;
        InFlightCount   = 0;
        m_SpawnOffset   = PROJ_SPAWN_OFFSET;
        m_WavesStarted  = false;

        bool ownerIsMonster = ParentSkill.SkillOwner.CompareTag(BattleGlobals.TAG_FOR_ENEMIES);

        if (ownerIsMonster)
        {
            ParentSkill.ToggleSpriteFlipX();
            m_SpawnOffset = -1 * m_SpawnOffset;
        }
    }
Пример #3
0
    protected override void OnEnable()
    {
        base.OnEnable();

        m_PreviousTarget     = new List <BattleNPC>();
        m_PreviousTargetTime = new List <float>();
        m_BeamStart.flipX    = m_DefaultStartFlipX;
        m_BeamEnd.flipX      = m_DefaultEndFlipX;

        Vector3 beamStartPos = BEAM_START_OFFSET;

        if (ParentSkill.SkillOwner.CompareTag(BattleGlobals.TAG_FOR_ENEMIES))
        {
            ParentSkill.ToggleSpriteFlipX();
            beamStartPos = -1 * beamStartPos;
        }
        beamStartPos += this.gameObject.transform.position;

        beamStart.tag                  = BattleGlobals.TAG_FOR_ENEMY_PROJ;
        m_PositiveDirection            = true;
        m_BeamStart.transform.position = beamStartPos;

        if ((NPCTargets != null))
        {
            BattleNPC primary = NPCTargets[BEAM_PRIMARY_TARGET].Focus;
            if (beamStartPos.x > primary.transform.position.x)
            {
                m_BeamStart.flipX   = !m_DefaultStartFlipX;
                m_BeamEnd.flipX     = !m_DefaultEndFlipX;
                m_PositiveDirection = false;
                m_BeamStart.tag     = BattleGlobals.TAG_FOR_HERO_PROJ;
            }
            m_TargetPosition = primary.StartPuck.transform.position;
        }

        _updateRotation();

        m_BeamStart.enabled  = true;
        m_BeamMiddle.enabled = true;
        m_BeamEnd.enabled    = true;
    }