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);
        }
Esempio n. 2
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.collider.CompareTag("Car"))
     {
         if (isCollision)
         {
             var sp = new SimpleParticle();
             sp.Init(transform.parent.Find("Effect/ColliderEffect").gameObject);
             sp.Play();
             MessageManager.GetInstance().Send((int)GameMessageDefine.CrossRoadGameFailure);
         }
     }
 }