Esempio n. 1
0
 private void PlayEffect(Transform effectPos, PoolObjectType type)
 {
     effectPos.Do((o) =>
     {
         string name      = type.ToString();
         EffectObject obj = GameCenter.Pools.GetPool <ObjectPoolComponent>(PoolUitlity.Po_EffectObject).Pop <EffectObject>(EffectObject.AssetsNamePrefix + name, (go) =>
         {
             return(go.Type == type);
         });
         if (obj != null)
         {
             obj.ExSetParent(o);
             obj.Execute();
         }
     });
 }
Esempio n. 2
0
        /// <summary>
        /// 播放3d特效
        /// </summary>
        public void PlayPlayerEffect(int chair, PoolObjectType type)
        {
            Transform effectPos = MahjongGroups.EffectposGroup[chair];

            effectPos.Do((o) =>
            {
                string name      = type.ToString();
                EffectObject obj = GameCenter.Pools.GetPool <ObjectPoolComponent>(PoolUitlity.Po_EffectObject)
                                   .Pop <EffectObject>(EffectObject.AssetsNamePrefix + name, (go) =>
                {
                    return(go.Type == type);
                });
                if (obj != null)
                {
                    obj.ExSetParent(o);
                    obj.Execute();
                }
            });
        }
Esempio n. 3
0
        private void SetPlayerDingqueFlag(int chair, int color)
        {
            PoolObjectType      effectType = PoolObjectType.none;
            EffectObject        effect     = null;
            List <EffectObject> list;

            if (0x10 == color)
            {
                effectType = PoolObjectType.dqwan;
            }
            else if (0x20 == color)
            {
                effectType = PoolObjectType.dqtiao;
            }
            else if (0x30 == color)
            {
                effectType = PoolObjectType.dqtong;
            }
            if (mDingquEffectCache.TryGetValue(chair, out list))
            {
                for (int i = 0; i < list.Count; i++)
                {
                    if (list[i].Type == effectType)
                    {
                        effect = list[i];
                    }
                }
                if (effect == null)
                {
                    effect = CreateDingqueEffect(mDingquEffectCache[chair], chair, effectType);
                }
            }
            else
            {
                mDingquEffectCache[chair] = new List <EffectObject>();
                effect = CreateDingqueEffect(mDingquEffectCache[chair], chair, effectType);
            }
            effect.gameObject.SetActive(true);
            effect.Execute();
        }