public void HideAllShields(PlanetArea area)
    {
        switch (area)
        {
        case PlanetArea.Up:
            m_lv2ShieldImgs[0].SetActive(false);
            m_lv3ShieldImgs[0].SetActive(false);
            break;

        case PlanetArea.Left:
            m_lv2ShieldImgs[1].SetActive(false);
            m_lv3ShieldImgs[1].SetActive(false);
            break;

        case PlanetArea.Down:
            m_lv2ShieldImgs[2].SetActive(false);
            m_lv3ShieldImgs[2].SetActive(false);
            break;

        case PlanetArea.Right:
            m_lv2ShieldImgs[3].SetActive(false);
            m_lv3ShieldImgs[3].SetActive(false);
            break;
        }
    }
Beispiel #2
0
    public void FlashArea(PlanetArea areaDir)
    {
        switch (areaDir)
        {
        case PlanetArea.Up:
            m_miniPlanet_up.SetActive(false);
            StopCoroutine("Coroutine_FlashArea");
            StartCoroutine("Coroutine_FlashArea", m_miniPlanet_up);
            break;

        case PlanetArea.Left:
            m_miniPlanet_left.SetActive(false);
            StopCoroutine("Coroutine_FlashArea");
            StartCoroutine("Coroutine_FlashArea", m_miniPlanet_left);
            break;

        case PlanetArea.Down:
            m_miniPlanet_down.SetActive(false);
            StopCoroutine("Coroutine_FlashArea");
            StartCoroutine("Coroutine_FlashArea", m_miniPlanet_down);
            break;

        case PlanetArea.Right:
            m_miniPlanet_right.SetActive(false);
            StopCoroutine("Coroutine_FlashArea");
            StartCoroutine("Coroutine_FlashArea", m_miniPlanet_right);
            break;
        }
    }
    protected override void _OnDying()
    {
        PlanetArea area = (PlanetArea)(BulletPoolIdx / 5);

        BattleGameObjectMgr.Inst.FlashMiniPlanet(area);
        TurretMgr.Inst.CheckShieldToShow(BulletPoolIdx, BulletPoolIdx);
    }
    public void CheckShieldToShow(int turretIdx, int exception = -1)
    {
        if (turretIdx < 0 || turretIdx >= m_turretSupportCtrs.Count)
        {
            Debug.Log("the focus idx is out of the range");
            return;
        }

        int        startIdx = (turretIdx / 5) * 5;
        PlanetArea area     = IdxToArea(startIdx);

        BattleGameObjectMgr.Inst.HideShields(area);

        for (int i = startIdx; i < startIdx + 5; ++i)
        {
            if (m_turretSupportCtrs[i].TurretCtrl == null)
            {
                continue;
            }

            if (i == exception)
            {
                continue;
            }

            BattleGameObjectMgr.Inst.ShowShield(area, m_turretSupportCtrs[i].TurretCtrl.TurretType);
        }
    }
    public void ShowShield(PlanetArea area, Turret turret)
    {
        switch (area)
        {
        case PlanetArea.Up:
            if (turret == Turret.Lv2_Shield)
            {
                m_lv2ShieldImgs[0].SetActive(true);
            }
            else if (turret == Turret.Lv3_Shield)
            {
                m_lv3ShieldImgs[0].SetActive(true);
            }
            break;

        case PlanetArea.Left:
            if (turret == Turret.Lv2_Shield)
            {
                m_lv2ShieldImgs[1].SetActive(true);
            }
            else if (turret == Turret.Lv3_Shield)
            {
                m_lv3ShieldImgs[1].SetActive(true);
            }
            break;

        case PlanetArea.Down:
            if (turret == Turret.Lv2_Shield)
            {
                m_lv2ShieldImgs[2].SetActive(true);
            }
            else if (turret == Turret.Lv3_Shield)
            {
                m_lv3ShieldImgs[2].SetActive(true);
            }
            break;

        case PlanetArea.Right:
            if (turret == Turret.Lv2_Shield)
            {
                m_lv2ShieldImgs[3].SetActive(true);
            }
            else if (turret == Turret.Lv3_Shield)
            {
                m_lv3ShieldImgs[3].SetActive(true);
            }
            break;
        }
    }
Beispiel #6
0
 public void FlashMiniPlanet(PlanetArea area)
 {
     m_miniPlanetCtrl.FlashArea(area);
 }
Beispiel #7
0
 public void HideShields(PlanetArea area)
 {
     m_shieldCtrl.HideAllShields(area);
 }
Beispiel #8
0
 public void ShowShield(PlanetArea area, Turret turret)
 {
     m_shieldCtrl.ShowShield(area, turret);
 }