protected void OnAnimalPlayLevelUpEffect(Message msg) { var _msg = msg as MessageInt; if (_msg.val != entityID) { return; } var cellAnimalUp = Config.animalupConfig.getInstace().getCell(this.animalID); var pool = PoolManager.GetInstance().GetGameObjectPool(cellAnimalUp.levelupeffect); var effGo = pool.New(); effGo.transform.position = Vector3.zero; effGo.transform.localScale = Vector3.one; effGo.transform.SetParent(this.cacheTrans, false); if (sp != null) { sp.UnInit(); } else { sp = new SimpleParticle(); } sp.Init(effGo); sp.Play(); effGo.transform.parent = null; pool.Delete(effGo); }
private static void PlayerSimpleParticle(Transform effectNode) { if (effectNode != null) { Transform trans = effectNode.Find("Fx_BuildUp"); if (trans == null) { trans = ResourceManager.GetInstance().LoadGameObject(Config.globalConfig.getInstace().BuildUpEffect2).transform; trans.SetParent(effectNode, false); } SimpleParticle sp = null; if (sp != null) { sp.UnInit(); } else { sp = new SimpleParticle(); } sp.Init(trans.gameObject); sp.Play(); } // //var cellAnimalUp = Config.animalupConfig.getInstace().getCell(this.animalID); //effGo.transform.position = Vector3.zero; //effGo.transform.localScale = Vector3.one; //effGo.transform.SetParent(this.cacheTrans, false); }