Ejemplo n.º 1
0
    void onClick_Return_Btn(GameObject caster)
    {
        Engine.IRenderSystem renderSys = Engine.RareEngine.Instance().GetRenderSystem();
        for (int i = m_CurShowEffect.Count - 1; i >= 0; i--)
        {
            Engine.IEffect effect = m_CurShowEffect[i];
            renderSys.RemoveEffect(effect);
        }
        m_CurShowEffect.Clear();

        ResetCameraAnimator();



        //返回选择角色界面
        if (DataManager.Manager <LoginDataManager>().RoleList.Count > 0)
        {
            StepManager.Instance.AddLoginScene(StepManager.CHOOSEROLESCENE, UnityEngine.SceneManagement.LoadSceneMode.Additive, (obj) =>
            {
                DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.ChooseRolePanel);
            });
        }
        else
        {
            //StepManager.Instance.AddLoginScene(StepManager.LOGINSCENE, (obj) =>
            //{
            //    DataManager.Manager<UIPanelManager>().ShowPanel(PanelID.LoginPanel);
            //});
            DataManager.Manager <LoginDataManager>().Logout(LoginPanel.ShowUIEnum.StartGame);
        }

        HideSelf();
    }
Ejemplo n.º 2
0
        public override void Dead()
        {
            Engine.IRenderSystem rs = Engine.RareEngine.Instance().GetRenderSystem();
            if (rs == null)
            {
                return;
            }

            Engine.IEffect effect = rs.GetEffect(m_uEffectID);
            if (effect != null)
            {
                rs.RemoveEffect(effect);
            }
        }
Ejemplo n.º 3
0
    private void LoadEffect(string strEffect, int nCount = 1)
    {
        Engine.IRenderSystem  renderSys = Engine.RareEngine.Instance().GetRenderSystem();
        Engine.IEffect        effect    = null;
        List <Engine.IEffect> temp      = new List <IEffect>();

        for (int i = 0; i < nCount; i++)
        {
            renderSys.CreateEffect(ref strEffect, ref effect, null, Engine.TaskPriority.TaskPriority_Normal, true);
            temp.Add(effect);
        }


        for (int i = 0; i < nCount; i++)
        {
            renderSys.RemoveEffect(temp[i]);
        }
        temp.Clear();
    }
Ejemplo n.º 4
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();
    }