Exemplo n.º 1
0
        /// <summary>
        /// Player移动到指定位置
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        private bool OnPlayerMove(OnPlayerMoveMsg msg)
        {
            isSuccess        = false;
            canTurnInfinite  = MissionData.GetLevelTurnInfinite(MissionManager.Instance.mCurLevel, MissionManager.Instance.mCurSubLevel);
            mInitialPosition = msg.mTargetPos;
            if (msg.isMoveDirectly)
            {
                gameObject.transform.position = msg.mTargetPos;
            }
            else
            {
                SetPlayerAngle(msg.mTargetPos - gameObject.transform.position, true);
                gameObject.GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 1);
                gameObject.transform.Find("Particle System").transform.gameObject.SetActive(true);
                gameObject.transform.DOMove(msg.mTargetPos, 4.0f).OnComplete(() =>
                {
                    gameObject.GetComponent <BoxCollider2D>().enabled = true;
                    isMoveable = true;
                    mTurnCount = mInitinalTurnCount;
                    UIManager.Instance.SetTurnCountText(mTurnCount - 1);
                    canCountDownTurn           = true;
                    canPlayMoveSound           = true;
                    canDoSuccess               = true;
                    canMove                    = true;
                    canDreaseTurnCount         = false;
                    this.transform.eulerAngles = new Vector3(0, 0, 0);
                    isFlying                   = false;
                    StartCoroutine(CheckAndShowGuidePanel(MissionManager.Instance.mCurSubLevel, 3.0f));
                });
            }
            //小球的初始化位置变为下一个位置

            return(false);
        }
Exemplo n.º 2
0
 //通过小关,清空石头list,再重新进行复制
 private bool OnSubLevelComplete(OnPlayerMoveMsg msg)
 {
     ClearStoneList();
     return(false);
 }