예제 #1
0
    /// <summary>
    /// 设置角色形象
    /// </summary>
    public void SetCharacterData()
    {
        if (characterUI)
        {
            characterUI.SetCharacterData(characterData.body, new CharacterEquipBean());
            if (CheckUtil.StringIsNull(selectHair))
            {
                cvHair.gameObject.SetActive(false);
            }
            else
            {
                cvHair.gameObject.SetActive(true);
                characterUI.SetCharacterData(BodyTypeEnum.Hair, selectHair, cvHair.GetColor());
            }

            if (CheckUtil.StringIsNull(selectMouth))
            {
                cvMouth.gameObject.SetActive(false);
            }
            else
            {
                cvMouth.gameObject.SetActive(true);
                characterUI.SetCharacterData(BodyTypeEnum.Mouth, selectMouth, cvMouth.GetColor());
            }

            if (CheckUtil.StringIsNull(selectEye))
            {
                cvEye.gameObject.SetActive(false);
            }
            else
            {
                cvEye.gameObject.SetActive(true);
                characterUI.SetCharacterData(BodyTypeEnum.Eye, selectEye, cvEye.GetColor());
            }

            if (CheckUtil.StringIsNull(selectSkin))
            {
                cvSkin.gameObject.SetActive(false);
            }
            else
            {
                cvSkin.gameObject.SetActive(true);
                characterUI.SetCharacterData(BodyTypeEnum.Skin, selectSkin, cvSkin.GetColor());
            }
        }
    }
예제 #2
0
 public void ColorChange(ColorView colorView, float r, float g, float b)
 {
     if (colorView == colorSkin)
     {
         characterBodyCpt.SetSkin(colorSkin.GetColor());
     }
     else if (colorView == colorHair)
     {
         characterBodyCpt.SetHair(colorHair.GetColor());
     }
     else if (colorView == colorEye)
     {
         characterBodyCpt.SetEye(colorEye.GetColor());
     }
     else if (colorView == colorMouth)
     {
         characterBodyCpt.SetMouth(colorMouth.GetColor());
     }
 }