示例#1
0
 public override void OnReset()
 {
     if (mAnbaoEffect != null)
     {
         GameCenter.Pools.GetPool <ObjectPoolComponent>(PoolUitlity.Po_EffectObject).Push(mAnbaoEffect);
         mAnbaoEffect = null;
     }
     DisplayBottom.gameObject.SetActive(false);
     GameCenter.Scene.MahjongCtrl.PushMahjongToPool(mDisplayMahjong);
     mDisplayMahjong = null;
 }
示例#2
0
        /// <summary>
        /// 设置翻宝麻将
        /// </summary>
        public MahjongContainer SetBaoMahjong(int bao, bool isShow = true)
        {
            DisplayBottom.gameObject.SetActive(true);
            var scene = GameCenter.Scene;

            if (mDisplayMahjong.ExIsNullOjbect())
            {
                mDisplayMahjong = scene.MahjongCtrl.PopMahjong();
            }
            mDisplayMahjong.Value = bao;
            mDisplayMahjong.Laizi = true;
            int quadrant = 1;

            if (!isShow)
            {
                if (mAnbaoEffect == null)
                {
                    var obj = GameCenter.Pools.GetPool <ObjectPoolComponent>(PoolUitlity.Po_EffectObject).Pop <EffectObject>(EffectObject.AssetsNamePrefix + PoolObjectType.anbao, (go) =>
                    {
                        return(go.Type == PoolObjectType.anbao);
                    });
                    if (obj != null)
                    {
                        obj.ExSetParent(DisplayBottom);
                        obj.gameObject.SetActive(true);
                        obj.transform.localPosition = GameCenter.DataCenter.Config.AnbaoPos;
                        obj.Execute();
                        if (!obj.AutoRecycle)
                        {
                            mAnbaoEffect = obj;
                        }
                    }
                }
                quadrant = -1;
            }
            else
            {
                if (mAnbaoEffect != null)
                {
                    mAnbaoEffect.gameObject.SetActive(false);
                }
            }
            var bottom = DisplayBottom.FindChild("bottom");

            mDisplayMahjong.transform.SetParent(bottom);
            mDisplayMahjong.transform.localPosition = new Vector3(0, 0.1f, 0);
            mDisplayMahjong.transform.localRotation = Quaternion.Euler(new Vector3(90 * quadrant, 0, 0));
            mDisplayMahjong.transform.localScale    = Vector3.one;
            mDisplayMahjong.gameObject.SetActive(true);
            //mDisplayMahjong.IsSign = true;
            return(mDisplayMahjong);
        }
示例#3
0
        private EffectObject CreateDingqueEffect(IList <EffectObject> list, int chair, PoolObjectType effectType)
        {
            EffectObject effect = MahjongUtility.PlayMahjongEffect(effectType);

            mDingquEffectCache[chair].Add(effect);
            var item = MahjongUtility.GetYxGameData().GetPlayerInfoItem <PlayerInfoItem>(chair);

            if (null != item)
            {
                var iamge = item.Owner.ExCompShow().GetComponent <Image>();
                iamge.enabled = false;
                effect.ExSetParent(iamge.transform);
            }
            return(effect);
        }
示例#4
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();
         }
     });
 }
示例#5
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();
                }
            });
        }
示例#6
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();
        }