Exemplo n.º 1
0
        /// <summary>
        /// 设置牌状态      -------------------服务器广播消息后  再由View调用 播放动画-------------------------------
        /// </summary>
        /// <param name="isPlayAnimation"></param>
        public void SetPokerStatus(bool isPlayAnimation)
        {
            //是否已经播放过动画
            if (isBeenPlayed)
            {
                return;
            }

            if (isPlayAnimation)
            {
                if (m_Poker.status == proto.paigow.PAIGOW_STATUS.SHOW)
                {
                    isBeenPlayed = true;
                    AppDebug.Log(string.Format("翻开牌{0}", m_Poker.ToChinese()));

                    tweener.OnComplete(

                        () => {
                        transform.localEulerAngles = m_Poker.status == proto.paigow.PAIGOW_STATUS.SHOW ? UIPokerShow : UIPokerHide;
                        AppDebug.Log("Poker旋转动画播放完毕");
                    }


                        ).Restart();
                }
                //else
                //{
                //    tweener.PlayBackwards();
                //}
            }
            else
            {
                transform.localEulerAngles = m_Poker.status == proto.paigow.PAIGOW_STATUS.SHOW ? UIPokerShow : UIPokerHide;
                if (m_Poker.status == proto.paigow.PAIGOW_STATUS.SHOW)
                {
                    isBeenPlayed = true;
                }
                AppDebug.Log(string.Format("transform.localEulerAngles{0}", transform.localEulerAngles));
            }
        }