public Vector3 DragCard(int card, bool isMy) //摸牌 { Game.SoundManager.PlayGetCard(); GameObject child = null; if (!isMy) { child = Game.PoolManager.CardPool.Spawn("Dragon_Blank"); } else { child = Game.PoolManager.CardPool.Spawn(card.ToString()); } if (null == child) { Debug.LogWarningFormat("没有找到牌模型 card:{0}", card); } Vector3 pos = handCardLayout.DragCard(card, child); EventDispatcher.DispatchEvent(MessageCommand.MJ_UpdatePlayPage); // TODO 摸的每张牌,上下可选择 //child.GetComponent<MJEntity>().reSetPoisiton += handCardLayout.cardSelect; //child.GetComponent<MJEntity>().onSendMessage += handCardLayout.cardPlay; return(pos); }
/// <summary> /// 初步理解为摸牌函数,自己的牌初始化为具体的麻将块 别人的牌初始化为发财 /// </summary> /// <param name="card"></param> /// <param name="isMy"></param> /// <returns></returns> public Vector3 DragCard(int card, bool isMy) { Game.SoundManager.PlayGetCard(); GameObject child = null; if (!isMy) { child = Game.PoolManager.CardPool.Spawn("Dragon_Blank"); } else { child = Game.PoolManager.CardPool.Spawn(card.ToString()); } if (null == child) { Debug.LogWarningFormat("没有找到牌模型 card:{0}", card); } Vector3 pos = handCardLayout.DragCard(card, child); EventDispatcher.DispatchEvent(MessageCommand.MJ_UpdatePlayPage); return(pos); }