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(); }
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); } }
IEffect GetEffectByID(uint id) { Engine.IRenderSystem rs = Engine.RareEngine.Instance().GetRenderSystem(); if (rs == null) { return(null); } Engine.IEffect effect = rs.GetEffect(id); if (effect != null) { return(effect); } return(null); }
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(); }
void OnActionEvent(ref string strEventName, ref string strAnimationName, float time, object param) { if (strEventName == "addEffect_scene" && strAnimationName == Client.EntityAction.ShowLog) { uint nEffectID = (uint)param; table.FxResDataBase edb = GameTableManager.Instance.GetTableItem <table.FxResDataBase>(nEffectID); if (edb != null) { table.ResourceDataBase resDB = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(edb.resPath); if (resDB != null) { string strPath = resDB.strPath; string strAttachNode = edb.attachNode; List <float> rotate = edb.rotate; //m_Avater.RenderObj.AddLinkEffect(ref strPath, ref strAttachNode, // new Vector3(edb.offset[0], edb.offset[1], edb.offset[2]), // Quaternion.identity, // Vector3.one); Engine.IRenderSystem renderSys = Engine.RareEngine.Instance().GetRenderSystem(); Engine.IEffect effect = null; Vector3 vecRotate = new Vector3(rotate[0], rotate[1], rotate[2]); UnityEngine.Quaternion q = new Quaternion(); q.eulerAngles = vecRotate; renderSys.CreateEffect(ref strPath, ref effect, null, Engine.TaskPriority.TaskPriority_Normal, true); effect.GetNode().SetLocalRotate(q); Vector3 pos = new Vector3(edb.offset[0], edb.offset[1], edb.offset[2]); effect.GetNode().SetLocalPosition(pos); m_CurShowEffect.Add(effect); } } } else if (strEventName == "addEffect_body" && strAnimationName == Client.EntityAction.ShowLog) { AssetBundle m_AssetBundle; uint nEffectID = (uint)param; table.FxResDataBase edb = GameTableManager.Instance.GetTableItem <table.FxResDataBase>(nEffectID); if (edb != null) { table.ResourceDataBase resDB = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(edb.resPath); if (resDB != null) { string strPath = resDB.strPath; string strAttachNode = edb.attachNode; List <float> rotate = edb.rotate; Vector3 vecRotate = new Vector3(rotate[0], rotate[1], rotate[2]); UnityEngine.Quaternion q = new Quaternion(); q.eulerAngles = vecRotate; m_Avater.RenderObj.AddLinkEffect(ref strPath, ref strAttachNode, new Vector3(edb.offset[0], edb.offset[1], edb.offset[2]), q, Vector3.one); } } } if (strEventName == "standAni" && strAnimationName == Client.EntityAction.ShowLog) { m_bLockRotate = false; m_Avater.PlayAni(Client.EntityAction.Show, null, 0.3f, -1); } if (strEventName == "Dissolve" && strAnimationName == Client.EntityAction.ShowLog) { RenderObjHelper.BeginDissolveEffect(m_Avater.RenderObj); } //if(strEventName=="end" && strAnimationName == Client.EntityAction.ShowLog) //{ // m_bLockRotate = false; // if (null != m_cam_animator) // { // m_cam_animator.SetInteger(m_istateChangeParamHash, 0); // } //m_Avater.PlayAni(Client.EntityAction.Show, null, 0.3f, -1); //} }
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(); }