예제 #1
0
    void UpdatePetAttribute()
    {
        _ATTR_LEVEL1 randomValue = CDataPool.Instance.RandomAttrs[getCurActiveIndex()];

        if (randomValue.m_pAttr == null)
        {
            randomValue.m_pAttr = new int[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_NUMBER];
        }
        UnityEngine.Color fontColor = UnityEngine.Color.green;
        SDATA_PET         curPet    = CDataPool.Instance.Pet_GetValidPet(getCurActiveIndex() - 1);//CDataPool.Instance.Pet_GetPet(getCurActiveIndex() - 1);

        if (curPet == null)
        {
            return;
        }

        textStr.Text = curPet.AttrStr + " + " + UnityEngine.Color.green + curPet.AttrStrBring;
        if (isActiveRoleRandomShowValue())
        {
            if (curPet.AttrStrBring > randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_STR])
            {
                fontColor = UnityEngine.Color.red;
            }
            else
            {
                fontColor = UnityEngine.Color.green;
            }
            textStrRandom.Hide(false);
            textStrRandom.Text = fontColor + randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_STR].ToString();
            SetButtonState(StrLevelUp,
                           StrLevelDown,
                           curPet.AttrStrBring,
                           randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_STR]);
        }
        else
        {
            textStrRandom.Hide(true);
            StrLevelUp.Hide(true);
            StrLevelDown.Hide(true);
        }

        textCon.Text = curPet.AttrCon + " + " + UnityEngine.Color.green + curPet.AttrConBring;
        if (isActiveRoleRandomShowValue())
        {
            if (curPet.AttrConBring > randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_CON])
            {
                fontColor = UnityEngine.Color.red;
            }
            else
            {
                fontColor = UnityEngine.Color.green;
            }
            textConRandom.Hide(false);
            textConRandom.Text = fontColor + randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_CON].ToString();
            SetButtonState(ConLevelUp,
                           ConLevelDown,
                           curPet.AttrConBring,
                           randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_CON]);
        }
        else
        {
            textConRandom.Hide(true);
            ConLevelUp.Hide(true);
            ConLevelDown.Hide(true);
        }

        textDex.Text = curPet.AttrDex + " + " + UnityEngine.Color.green + curPet.AttrDexBring;
        if (isActiveRoleRandomShowValue())
        {
            if (curPet.AttrDexBring > randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_DEX])
            {
                fontColor = UnityEngine.Color.red;
            }
            else
            {
                fontColor = UnityEngine.Color.green;
            }
            textDexRandom.Hide(false);
            textDexRandom.Text = fontColor + randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_DEX].ToString();
            SetButtonState(DexLevelUp,
                           DexLevelDown,
                           curPet.AttrDexBring,
                           randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_DEX]);
        }
        else
        {
            textDexRandom.Hide(true);
            DexLevelUp.Hide(true);
            DexLevelDown.Hide(true);
        }


        textSpr.Text = curPet.AttrSpr + " + " + UnityEngine.Color.green + curPet.AttrSprBring;
        if (isActiveRoleRandomShowValue())
        {
            if (curPet.AttrSprBring > randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_SPR])
            {
                fontColor = UnityEngine.Color.red;
            }
            else
            {
                fontColor = UnityEngine.Color.green;
            }
            textSprRandom.Hide(false);
            textSprRandom.Text = fontColor + randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_SPR].ToString();
            SetButtonState(SprLevelUp,
                           SprLevelDown,
                           curPet.AttrSprBring,
                           randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_SPR]);
        }
        else
        {
            textSprRandom.Hide(true);
            SprLevelUp.Hide(true);
            SprLevelDown.Hide(true);
        }

        textInt.Text = curPet.AttrInt + " + " + UnityEngine.Color.green + curPet.AttrIntBring;
        if (isActiveRoleRandomShowValue())
        {
            if (curPet.AttrIntBring > randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_INT])
            {
                fontColor = UnityEngine.Color.red;
            }
            else
            {
                fontColor = UnityEngine.Color.green;
            }
            textIntRandom.Hide(false);
            textIntRandom.Text = fontColor + randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_INT].ToString();
            SetButtonState(IntLevelUp,
                           IntLevelDown,
                           curPet.AttrIntBring,
                           randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_INT]);
        }
        else
        {
            textIntRandom.Hide(true);
            IntLevelUp.Hide(true);
            IntLevelDown.Hide(true);
        }
    }
예제 #2
0
    void UpdateAvaterAttribute()
    {
        _ATTR_LEVEL1 randomValue = CDataPool.Instance.RandomAttrs[0];

        if (randomValue.m_pAttr == null)
        {
            randomValue.m_pAttr = new int[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_NUMBER];
        }

        textStr.Text = PlayerMySelf.Instance.GetData("STR") + "+" + UnityEngine.Color.green + PlayerMySelf.Instance.GetData("BRING_STR");
        UnityEngine.Color fontColor = UnityEngine.Color.green;
        if (isActiveRoleRandomShowValue())
        {
            if (CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_BringSTR() > randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_STR])
            {
                fontColor = UnityEngine.Color.red;
            }
            else
            {
                fontColor = UnityEngine.Color.green;
            }

            textStrRandom.Hide(false);
            textStrRandom.Text = fontColor + randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_STR].ToString();
            SetButtonState(StrLevelUp,
                           StrLevelDown,
                           CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_BringSTR(),
                           randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_STR]);
        }
        else
        {
            textStrRandom.Hide(true);
            StrLevelUp.Hide(true);
            StrLevelDown.Hide(true);
        }

        textCon.Text = PlayerMySelf.Instance.GetData("CON") + "+" + UnityEngine.Color.green + PlayerMySelf.Instance.GetData("BRING_CON");
        if (isActiveRoleRandomShowValue())
        {
            if (CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_BringCON() > randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_CON])
            {
                fontColor = UnityEngine.Color.red;
            }
            else
            {
                fontColor = UnityEngine.Color.green;
            }
            textConRandom.Hide(false);
            textConRandom.Text = fontColor + randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_CON].ToString();
            SetButtonState(ConLevelUp,
                           ConLevelDown,
                           CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_BringCON(),
                           randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_CON]);
        }
        else
        {
            textConRandom.Hide(true);
            ConLevelUp.Hide(true);
            ConLevelDown.Hide(true);
        }

        textInt.Text = PlayerMySelf.Instance.GetData("INT") + "+" + UnityEngine.Color.green + PlayerMySelf.Instance.GetData("BRING_INT");
        if (isActiveRoleRandomShowValue())
        {
            if (CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_BringINT() > randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_INT])
            {
                fontColor = UnityEngine.Color.red;
            }
            else
            {
                fontColor = UnityEngine.Color.green;
            }
            textIntRandom.Hide(false);
            textIntRandom.Text = fontColor + randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_INT].ToString();
            SetButtonState(IntLevelUp,
                           IntLevelDown,
                           CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_BringINT(),
                           randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_INT]);
        }
        else
        {
            textIntRandom.Hide(true);
            IntLevelUp.Hide(true);
            IntLevelDown.Hide(true);
        }

        textSpr.Text = PlayerMySelf.Instance.GetData("SPR") + "+" + UnityEngine.Color.green + PlayerMySelf.Instance.GetData("BRING_SPR");
        if (isActiveRoleRandomShowValue())
        {
            if (CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_BringSPR() > randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_SPR])
            {
                fontColor = UnityEngine.Color.red;
            }
            else
            {
                fontColor = UnityEngine.Color.green;
            }
            textSprRandom.Hide(false);
            textSprRandom.Text = fontColor + randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_SPR].ToString();
            SetButtonState(SprLevelUp,
                           SprLevelDown,
                           CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_BringSPR(),
                           randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_SPR]);
        }
        else
        {
            textSprRandom.Hide(true);
            SprLevelUp.Hide(true);
            SprLevelDown.Hide(true);
        }

        textDex.Text = PlayerMySelf.Instance.GetData("DEX") + "+" + UnityEngine.Color.green + PlayerMySelf.Instance.GetData("BRING_DEX");
        if (isActiveRoleRandomShowValue())
        {
            if (CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_BringDEX() > randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_DEX])
            {
                fontColor = UnityEngine.Color.red;
            }
            else
            {
                fontColor = UnityEngine.Color.green;
            }
            textDexRandom.Hide(false);
            textDexRandom.Text = fontColor + randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_DEX].ToString();
            SetButtonState(DexLevelUp,
                           DexLevelDown,
                           CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_BringDEX(),
                           randomValue[(int)CHAR_ATTR_LEVEL1.CATTR_LEVEL1_DEX]);
        }
        else
        {
            textDexRandom.Hide(true);
            DexLevelUp.Hide(true);
            DexLevelDown.Hide(true);
        }
    }