Ejemplo n.º 1
0
        public static string GetProfessionNameByType(enumProfession type)
        {
            switch (type)
            {
            case enumProfession.Profession_Soldier:
                return("战士");

            //case enumProfession.Profession_Spy:
            //	return "刺客";
            case enumProfession.Profession_Gunman:
                return("弓手");

            //case enumProfession.Profession_Blast:
            //	return "魔炮";
            case enumProfession.Profession_Freeman:
                return("法师");

            case enumProfession.Profession_Doctor:
                return("牧师");

            default:
                return("无效职业");
            }
        }
Ejemplo n.º 2
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();
    }
Ejemplo n.º 3
0
 void OnSelect(enumProfession profession)
 {
     OnSelChanged(profession, m_sel_sex);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 生成动画名称
 /// </summary>
 /// <param name="profess"></param>
 /// <returns></returns>
 private string BuildAnimFullName(enumProfession profess)
 {
     return(string.Format("Base Layer.{0}", profess.ToString()));
 }
Ejemplo n.º 5
0
    /// <summary>
    /// 钓鱼,使用鱼竿
    /// </summary>
    public void OnFishingRodSuit(IEntity en)
    {
        enumProfession job    = (enumProfession)en.GetProp((int)PlayerProp.Job);
        uint           suitid = 0;

        switch (job)
        {
        //战士
        case enumProfession.Profession_Soldier:
            suitid = 2521;
            break;

        //幻师
        case enumProfession.Profession_Spy:
            int statues = en.GetProp((int)PlayerProp.SkillStatus);
            //魔医形态用战士的时装id
            if (statues == 1)
            {
                suitid = 2522;
            }
            else
            {
                suitid = 2522;
            }
            break;

        //法师
        case enumProfession.Profession_Freeman:
            suitid = 2523;
            break;

        //暗巫
        case enumProfession.Profession_Doctor:
            suitid = 2524;
            break;
        }
        IPlayer player = en as IPlayer;

        if (player == null)
        {
            return;
        }

        //需要保存的suitId
        uint saveSuitId = 0;

        List <GameCmd.SuitData> suitList = null;

        player.GetSuit(out suitList);
        if (suitList != null)
        {
            for (int i = 0; i < suitList.Count; i++)
            {
                SuitData data = suitList[i];
                if (data.suit_type == EquipSuitType.Qibing_Type)
                {
                    //if (data.baseid != 0)
                    {
                        //CurWeaponSuitID = data.baseid;
                        saveSuitId = data.baseid;
                    }
                }
            }
        }

        if (m_playerSuitDic.ContainsKey(player.GetID()))
        {
            m_playerSuitDic.Remove(player.GetID());
        }
        m_playerSuitDic.Add(player.GetID(), saveSuitId);

        //鱼竿数据
        if (m_playerFishingDic.ContainsKey(player.GetID()))
        {
            m_playerFishingDic.Remove(player.GetID());
        }
        m_fishingPlayerId = player.GetID();

        SendChangeBody(2, suitid, player);
        SendChangeRenderObj(suitid, 2, player.GetID());
    }
Ejemplo n.º 6
0
    public void OnMiningTreasureMapToChangeWeapon(IEntity en)
    {
        enumProfession job    = (enumProfession)en.GetProp((int)PlayerProp.Job);
        uint           suitid = 0;

        switch (job)
        {
        //战士
        case enumProfession.Profession_Soldier:
            suitid = 2511;
            break;

        //幻师
        case enumProfession.Profession_Spy:
            int statues = en.GetProp((int)PlayerProp.SkillStatus);
            //魔医形态用战士的时装id
            if (statues == 1)
            {
                suitid = 2512;
            }
            else
            {
                suitid = 2511;
            }
            break;

        //法师
        case enumProfession.Profession_Freeman:
            suitid = 2513;
            break;

        //暗巫
        case enumProfession.Profession_Doctor:
            suitid = 2514;
            break;
        }
        IPlayer player = en as IPlayer;

        if (player == null)
        {
            return;
        }
        List <GameCmd.SuitData> suitList = null;

        player.GetSuit(out suitList);
        if (suitList != null)
        {
            for (int i = 0; i < suitList.Count; i++)
            {
                SuitData data = suitList[i];
                if (data.suit_type == EquipSuitType.Qibing_Type)
                {
                    if (data.baseid != 0)
                    {
                        CurWeaponSuitID = data.baseid;
                    }
                }
            }
        }
        SendChangeBody(2, suitid, player);
        SendChangeRenderObj(suitid, 2, player.GetID());
    }