Transform CreateEffect(int num = 1) { Engine.IEffect m_effect = null; for (int i = 0; i < num; i++) { Engine.IRenderSystem rs = Engine.RareEngine.Instance().GetRenderSystem(); if (rs != null) { table.ResourceDataBase rd = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(50007); if (rd == null) { return(null); } string path = rd.strPath; bool success = rs.CreateEffect(ref path, ref m_effect, OnCreateEffectEvent, Engine.TaskPriority.TaskPriority_Immediate); if (success) { m_effect.GetNode().SetScale(Vector3.one); m_effect.GetNode().GetTransForm().SetChildLayer(LayerMask.NameToLayer("UI")); } } } if (m_effect != null) { return(m_effect.GetNodeTransForm()); } return(null); }
void OnCreateEffectEvent(Engine.IEffect effect) { if (effect == null) { return; } effect.GetNode().GetTransForm().SetChildLayer(LayerMask.NameToLayer("UI")); ParticleSystem[] particle = effect.GetNode().GetTransForm().GetComponentsInChildren <ParticleSystem>(); foreach (var item in particle) { Renderer render = item.GetComponent <Renderer>(); if (render != null) { render.material.renderQueue = 3320; } } }
private void UpdateEffectWidget() { if (null != m_effect) { Engine.Node node = m_effect.GetNode(); if (node != null) { Transform trans = node.GetTransForm(); if (trans != null) { trans.parent = cachedTransform; node.SetLocalPosition(Vector3.zero); trans.localScale = Vector3.one; trans.SetChildLayer(LayerMask.NameToLayer("UI")); } } } }