Ejemplo n.º 1
0
 /// <summary>
 /// 飞升红点
 /// </summary>
 public void SetSoarRedMind(ActorBaseTag tag, ulong value, bool _fromAbility)
 {
     if (tag == ActorBaseTag.HighFlyUpRes || tag == ActorBaseTag.LowFlyUpRes)
     {
         if (data == null || data.stratNum >= ConfigMng.Instance.GetStyliteRefTable().Count - 1)
         {
             GameCenter.mainPlayerMng.SetFunctionRed(FunctionType.SOARING, false);
             return;
         }
         bool isRed = false;
         if ((70 * (data.stratNum / 70) + (data.stratNum / 70 - 1)) == data.stratNum && data.stratNum > 0)
         {
             FlyUpRef flyUpRef = ConfigMng.Instance.GetFlyUpRef((data.stratNum) / 70 + 1);
             if (flyUpRef != null)
             {
                 if (GameCenter.mainPlayerMng.MainPlayerInfo.HighFlyUpRes >= flyUpRef.xianQi && GameCenter.mainPlayerMng.MainPlayerInfo.CurLevel >= flyUpRef.needLev)
                 {
                     isRed = true;
                 }
             }
         }
         else
         {
             StyliteRef nextStyliteRef = ConfigMng.Instance.GetStyliteRefByStart(data.stratNum + 1);
             if (nextStyliteRef != null)
             {
                 if (GameCenter.mainPlayerMng.MainPlayerInfo.LowFlyUpRes >= nextStyliteRef.lingqi)
                 {
                     isRed = true;
                 }
             }
         }
         GameCenter.mainPlayerMng.SetFunctionRed(FunctionType.SOARING, isRed);
     }
 }
Ejemplo n.º 2
0
    public void SetLeft(int _start, bool _isBreak)
    {
        StyliteRef _styliteRef;

        _styliteRef = ConfigMng.Instance.GetStyliteRefByStart(_start + 1);
        FlyUpRef flyUpRef = ConfigMng.Instance.GetFlyUpRef(_styliteRef.jingJieId);
        int      id       = 1;

        id = (_styliteRef.jieDuan - 1) * 7 + 71 * (_styliteRef.jingJieId - 1) > 0 ? (_styliteRef.jieDuan - 1) * 7 + 71 * (_styliteRef.jingJieId - 1) : 7;
        if ((70 * (_start / 70) + (_start / 70 - 1)) == _start && _start > 0)
        {
            id = _start;
        }
        StyliteRef stylite = ConfigMng.Instance.GetStyliteRefByStart(id);//左边属性

        if (isUpData)
        {
            if (_start < 7)
            {
                for (int i = 0, len = attibute.Length; i < len; i++)
                {
                    if (_start % 7 > i)
                    {
                        SetLeftLabelText(attibute[i], stylite.attr[i]);
                    }
                    else
                    {
                        SetLeftLabelText(attibute[i], 0);
                    }
                }
                if (flyUpRef != null && levName != null)
                {
                    levName.text = ConfigMng.Instance.GetUItext(21,
                                                                new string[2] {
                        flyUpRef.name, "0"
                    });
                    levName.transform.localPosition = new Vector3(580, 174.8f, 0);
                }
                return;
            }
            for (int i = 0, len = attibute.Length; i < len; i++)
            {
                if ((_start - (_start / 71)) % 7 > i)
                {
                    SetLeftLabelText(attibute[i], _styliteRef.attr[i]);
                }
                else
                {
                    SetLeftLabelText(attibute[i], stylite.attr[i]);
                }
            }
            if ((70 * (_start / 70) + (_start / 70 - 1)) == _start && _start > 0)
            {
                FlyUpRef fly = ConfigMng.Instance.GetFlyUpRef(_styliteRef.jingJieId);
                if (fly != null && levName != null)
                {
                    levName.text = ConfigMng.Instance.GetUItext(21,
                                                                new string[2] {
                        fly.name, "10"
                    });
                }
            }
            else
            {
                FlyUpRef fly = ConfigMng.Instance.GetFlyUpRef(_styliteRef.jingJieId);
                if (fly != null && levName != null)
                {
                    levName.text = ConfigMng.Instance.GetUItext(21,
                                                                new string[2] {
                        fly.name, (_styliteRef.jieDuan - 1).ToString()
                    });
                }
            }
            if (_isBreak)
            {
                levName.transform.localPosition = new Vector3(519, 174.8f, 0);
            }
            else
            {
                levName.transform.localPosition = new Vector3(580, 174.8f, 0);
            }
        }
        else//修改为可以加的才属性才显示
        {
            if (_start == 0)
            {
                for (int i = 0, len = attibute.Length; i < len; i++)
                {
                    if (_start == i)
                    {
                        attibute[i].gameObject.SetActive(true);
                        SetLabelText(attibute[i], 0, _styliteRef.attr[i] - 0, i);
                    }
                    else
                    {
                        attibute[i].gameObject.SetActive(false);
                        //SetLabelText(attibute[i], _styliteRef.attr[i], 0);
                    }
                }
            }
            else if (_start < 7)
            {
                for (int i = 0, len = attibute.Length; i < len; i++)
                {
                    if (_start % 7 > i)
                    {
                        attibute[i].gameObject.SetActive(false);
                        //SetLabelText(attibute[i], stylite.attr[i], 0);
                    }
                    else if (_start % 7 == i)
                    {
                        attibute[i].gameObject.SetActive(true);
                        SetLabelText(attibute[i], 0, stylite.attr[i] - 0, i);
                    }
                    else
                    {
                        attibute[i].gameObject.SetActive(false);
                        //SetLabelText(attibute[i], 0, 0);
                    }
                }
            }
            else
            {
                for (int i = 0, len = attibute.Length; i < len; i++)
                {
                    if ((_start - (_start / 71)) % 7 > i)
                    {
                        attibute[i].gameObject.SetActive(false);
                        //SetLabelText(attibute[i], _styliteRef.attr[i], 0);
                    }
                    else if ((_start - (_start / 71)) % 7 == i)
                    {
                        attibute[i].gameObject.SetActive(true);
                        SetLabelText(attibute[i], stylite.attr[i], _styliteRef.attr[i] - stylite.attr[i], i);
                    }
                    else
                    {
                        attibute[i].gameObject.SetActive(false);
                        //SetLabelText(attibute[i], stylite.attr[i], 0);
                    }
                }
            }
            if ((70 * (_start / 70) + (_start / 70 - 1)) == _start && _start > 0)//70/141/212/283.....突破
            {
                for (int i = 0, len = attibute.Length; i < len; i++)
                {
                    if (flyUpRef != null)
                    {
                        attibute[i].gameObject.SetActive(true);
                        SetLabelText(attibute[i], stylite.attr[i], _styliteRef.attr[i] - stylite.attr[i], -1);
                    }
                }
            }
            if ((70 * (_start / 70) + (_start / 70 - 1)) == _start && _start > 0)
            {
                FlyUpRef fly = ConfigMng.Instance.GetFlyUpRef((_start + 1) / 71 + 1);
                if (fly != null && levName != null)
                {
                    levName.text = ConfigMng.Instance.GetUItext(21,
                                                                new string[2] {
                        fly.name, "0"
                    });
                }
            }
            else
            {
                if (flyUpRef != null && levName != null)
                {
                    levName.text = ConfigMng.Instance.GetUItext(21,
                                                                new string[2] {
                        flyUpRef.name, _styliteRef.jieDuan.ToString()
                    });
                }
            }
            if (_isBreak)
            {
                levName.gameObject.SetActive(true);
            }
            else
            {
                levName.gameObject.SetActive(false);
            }
        }
    }
Ejemplo n.º 3
0
    void Refresh()
    {
        PracticeData data = GameCenter.practiceMng.data;

        if (data == null)
        {
            return;
        }
        if (data.stratNum >= ConfigMng.Instance.GetStyliteRefTable().Count - 1)//满级
        {
            int id = ConfigMng.Instance.GetStyliteRefTable().Count - 1;
            if (curAttributeUi != null)
            {
                curAttributeUi.SetFullLev(id);
            }
            if (nextAttributeUi != null)
            {
                nextAttributeUi.SetFullLev(id);
            }
            for (int i = 0; i < starts.Length; i++)
            {
                starts[i].gameObject.SetActive(true);
            }
            if (breakOut != null)
            {
                breakOut.gameObject.SetActive(false);
            }
            if (promote != null)
            {
                promote.gameObject.SetActive(false);
            }
            if (manji != null)
            {
                manji.gameObject.SetActive(true);
            }
            return;
        }
        if (manji != null && manji.gameObject.activeSelf)
        {
            manji.gameObject.SetActive(false);
        }


        if ((70 * (data.stratNum / 70) + (data.stratNum / 70 - 1)) == data.stratNum && data.stratNum > 0)//突破
        {
            FlyUpRef flyUpRef = ConfigMng.Instance.GetFlyUpRef((data.stratNum) / 70 + 1);
            if (flyUpRef != null)
            {
                if (breakOut != null)
                {
                    if (curAttributeUi != null)
                    {
                        curAttributeUi.SetLeft(data.stratNum, true);
                    }
                    if (nextAttributeUi != null)
                    {
                        nextAttributeUi.SetLeft(data.stratNum, true);
                    }
                    breakOut.gameObject.SetActive(true);
                    breakOut.Show(flyUpRef.xianQi, true, flyUpRef.needLev);
                }
                if (promote != null)
                {
                    promote.gameObject.SetActive(false);
                }
            }
        }
        else//提升
        {
            StyliteRef nextStyliteRef = ConfigMng.Instance.GetStyliteRefByStart(data.stratNum + 1);
            if (nextStyliteRef != null)
            {
                if (promote != null)
                {
                    if (curAttributeUi != null)
                    {
                        curAttributeUi.SetLeft(data.stratNum, false);
                    }
                    if (nextAttributeUi != null)
                    {
                        nextAttributeUi.SetLeft(data.stratNum, false);
                    }
                    promote.gameObject.SetActive(true);
                    promote.Show(nextStyliteRef.lingqi, false);
                }
                if (breakOut != null)
                {
                    breakOut.gameObject.SetActive(false);
                }
            }
        }
        if (practiceEffect != null && GameCenter.practiceMng.bodyEffectNum > 0)
        {
            practiceEffect.ShowBodyEffects(GameCenter.practiceMng.bodyEffectNum / 71 + 1);
        }


        for (int i = 0; i < starts.Length; i++)
        {
            if (starts[i] != null)
            {
                if (data.stratNum < 70)
                {
                    if ((data.stratNum) % 7 > i && (70 * (data.stratNum / 70) + (data.stratNum / 70 - 1)) != data.stratNum)
                    {
                        starts[i].gameObject.SetActive(true);
                    }
                    else
                    {
                        starts[i].gameObject.SetActive(false);
                    }
                    if ((data.stratNum) % 7 == 0 && data.stratNum > 0 && (70 * (data.stratNum / 70) + (data.stratNum / 70 - 1)) != data.stratNum)
                    {
                        starts[i].gameObject.SetActive(true);
                        CancelInvoke("HideAllStar");
                        Invoke("HideAllStar", 0.3f);
                    }
                }
                else
                {
                    if ((data.stratNum - (data.stratNum / 71)) % 7 > i && (70 * (data.stratNum / 70) + (data.stratNum / 70 - 1)) != data.stratNum)
                    {
                        starts[i].gameObject.SetActive(true);
                    }
                    else
                    {
                        starts[i].gameObject.SetActive(false);
                    }
                    if ((data.stratNum - (data.stratNum / 71)) % 7 == 0 && (70 * (data.stratNum / 70) + (data.stratNum / 70 - 1)) != data.stratNum)
                    {
                        starts[i].gameObject.SetActive(true);
                        CancelInvoke("HideAllStar");
                        Invoke("HideAllStar", 0.3f);
                    }
                }
            }
        }
        if (((70 * (data.stratNum / 70) + (data.stratNum / 70 - 1)) == data.stratNum) && data.stratNum > 0)
        {
            for (int i = 0; i < starts.Length; i++)
            {
                if (starts[i] != null)
                {
                    starts[i].gameObject.SetActive(true);
                }
            }
        }
    }