Пример #1
0
    public static string GetSpriteName(GameCmd.enumProfession type)
    {
        switch (type)
        {
        case enumProfession.Profession_Blast:
            break;

        case enumProfession.Profession_Doctor:
            return("touxiang_zhu_wushi");

        case enumProfession.Profession_Freeman:
            return("touxiang_zhu_fashi");

        case enumProfession.Profession_Gunman:
            break;

        case enumProfession.Profession_Max:
            break;

        case enumProfession.Profession_None:
            break;

        case enumProfession.Profession_Soldier:
            return("touxiang_zhu_zhanshi");

        case enumProfession.Profession_Spy:
            return("touxiang_zhu_huanshi");

        default:
            break;
        }
        return("");
    }
Пример #2
0
    string GetSpriteName(GameCmd.enumProfession type)
    {
        IPlayer player   = MainPlayerHelper.GetMainPlayer();
        string  headIcon = "";

        if (player != null)
        {
            uint job = (uint)type;
            int  sex = player.GetProp((int)PlayerProp.Sex);
            if (headIconDic.ContainsKey((uint)type))
            {
                headIcon = headIconDic[job];
            }
            else
            {
                SelectRoleDataBase sdb = table.SelectRoleDataBase.Where(type, (GameCmd.enmCharSex)sex);
                if (sdb != null)
                {
                    headIcon = sdb.mainUIHeadIcon;
                    headIconDic.Add(job, headIcon);
                }
            }
        }
        return(headIcon);
    }
Пример #3
0
 private GameObject GetPropDesContent(GameCmd.enumProfession pro)
 {
     if (m_dicProDes.ContainsKey(pro))
     {
         return(m_dicProDes[pro]);
     }
     return(null);
 }
Пример #4
0
 private UICreateRoleGrid GetGridByPro(GameCmd.enumProfession pro)
 {
     if (null != m_dicGrid && m_dicGrid.ContainsKey(pro))
     {
         return(m_dicGrid[pro]);
     }
     return(null);
 }
Пример #5
0
 private void ResetCharacterCreate()
 {
     if (null != m_rightDesTA)
     {
         m_rightDesTA.ResetToBeginning();
     }
     if (m_curPro != enumProfession.Profession_None)
     {
         GetGridByPro(m_curPro).SetSelect(false, false);
         GetPropDesContent(m_curPro).SetActive(false);
     }
     m_curPro = enumProfession.Profession_None;
     m_prePro = enumProfession.Profession_None;
 }
Пример #6
0
    void OnSelChanged(enumProfession prof, enmCharSex sex, bool force = false)
    {
        if (m_curPro == prof && m_sel_sex == sex && force == false)
        {
            //没有改变
            return;
        }
        m_bLockRotate = true;
        bool havePre = m_curPro != enumProfession.Profession_None;

        GetGridByPro(prof).SetSelect(true, havePre);
        GetPropDesContent(prof).SetActive(true);
        if (havePre)
        {
            if (null != m_rightDesTA)
            {
                m_rightDesTA.ResetToBeginning();
                m_rightDesTA.Play(true);
            }
            GetGridByPro(m_curPro).SetSelect(false);
            GetPropDesContent(m_curPro).SetActive(false);
        }
        else
        {
            if (m_rightDesTA != null)
            {
                m_rightDesTA.GetComponent <UIWidget>().alpha = m_rightDesTA.to;
            }
        }
        m_prePro = m_curPro;
        m_curPro = prof;
        if (m_curPro == enumProfession.Profession_Soldier || m_curPro == enumProfession.Profession_Freeman)
        {
            sex = enmCharSex.MALE;
        }
        else
        {
            sex = enmCharSex.FEMALE;
        }
        m_sel_sex = sex;
        //for (int i = 0; i < m_lstCreateRoleBtn.Count; i++)
        //{
        //    m_lstCreateRoleBtn[i].ToggleSelectMask(m_lstCreateRoleBtn[i].m_enumProfession == m_sel_profession);
        //}

        if (m_char_obj != null)
        {
            GameObject.Destroy(m_char_obj);
        }

        //if(m_sel_sex == enmCharSex.MALE)
        //{
        //    m_sprite_male_bg.spriteName = "nan_liang";
        //    m_sprite_female_bg.spriteName = "nv_an";
        //}
        //else
        //{
        //    m_sprite_male_bg.spriteName = "nan_an";
        //    m_sprite_female_bg.spriteName = "nv_liang";
        //}


        //随机一个名字
        onClick_Random_name_Btn(null);

        //if(m_sel_sex == enmCharSex.MALE)
        //    StartCoroutine(LoadModel("ZS_Male_Show"));
        //else
        //    StartCoroutine(LoadModel("ZS_Female_Show"));

        var t = Table.Query <table.SelectRoleDataBase>();

        table.SelectRoleDataBase item = null;
        for (int i = 0; i < t.Count; i++)
        {
            if (t[i].professionID == (uint)m_curPro && t[i].Sex == m_sel_sex)
            {
                item = t[i];
                break;
            }
        }
        // var item = table.SelectRoleDataBase.Where(m_sel_profession, m_sel_sex);

        if (item == null || (item != null && string.IsNullOrEmpty(item.bodyPathRoleShowcase)))
        {
            Log.Error("角色展示模型未配置,请检查选人界面表!");
            return;
        }


        if (m_Avater != null)
        {
            RenderObjHelper.EndDissolveEffect(m_Avater.RenderObj);
        }
        if (m_Avater != null)
        {
            m_Avater.Destroy();
            m_Avater = null;
        }

        if (m_model_node == null)
        {
            Engine.Utility.Log.Error("m_model_node 为 null !!!");
            return;
        }

        m_model_node.transform.DestroyChildren();
        rotateY = m_model_node.localRotation.y;

        //var table_data = GameTableManager.Instance.GetTableItem<table.SuitDataBase>((uint)item.createRoleResID);


        //创建角色,模型自带武器
        var ritem = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>((uint)item.createRoleResID);

        if (ritem == null)
        {
            Engine.Utility.Log.Error("ritem 为 null !!!");
            return;
        }

        Client.AvatarUtil.CreateAvater(ref m_Avater, ritem.strPath, m_model_node, m_model_node.gameObject.layer, OnCreateAvater, (int)prof);

        Engine.IRenderSystem renderSys = Engine.RareEngine.Instance().GetRenderSystem();
        if (renderSys == null)
        {
            return;
        }

        for (int i = m_CurShowEffect.Count - 1; i >= 0; i--)
        {
            Engine.IEffect effect = m_CurShowEffect[i];
            renderSys.RemoveEffect(effect);
        }
        m_CurShowEffect.Clear();
    }
Пример #7
0
 public static SelectRoleDataBase Where(GameCmd.enumProfession profession, GameCmd.enmCharSex sexman)
 {
     return((from i in Table.Query <SelectRoleDataBase>() where i.Profession == profession && i.Sex == sexman select i).FirstOrDefault());
 }