Ejemplo n.º 1
0
 /// <summary>
 /// 进入下一个小关卡
 /// </summary>
 public void GoToNextSubLevel()
 {
     if (mCurSubLevel < mMaxSubLevel)
     {
         UpdateMissionLevel(mCurLevel, mCurSubLevel + 1);
         //不移动镜头的做法
         //SceneManager.LoadSceneAsync("Level" + mCurLevel + "-" + mCurSubLevel);
         //移动镜头的做法
         MessageBus.Send(new OnCameraMoveMsg(MissionData.GetCameraPosition(mCurLevel, mCurSubLevel), false));
         MessageBus.Send(new OnPlayerMoveMsg(MissionData.GetPlayerPosition(mCurLevel, mCurSubLevel), false));
     }
     else
     {
         //这里应该是跳转到某个大关卡过关完的连成星座并展示星座图的画面
         MessageBus.Send(new OnLevelCompleteMsg());
     }
 }
Ejemplo n.º 2
0
        private IEnumerator FlyStoneAndFade()
        {
            isAniComplete = false;
            //这里播放特效
            UFO.SetActive(true);
            //播放音乐
            AudioManager.Instance.PlayOneShotIndex(4);
            Animator animator = UFO.GetComponent <Animator>();

            animator.enabled = true;
            animator.Play("UFOAni", -1, 0.0f);
            yield return(new WaitForSeconds(1.5f));

            List <GameObject> stoneList = StoneManager.Instance.GetRadomStoneTrasform();

            for (int i = 0; i < stoneList.Count; i++)
            {
                GameObject stone = stoneList[i];
                Vector3    initinalStonePosition = stone.gameObject.transform.position;
                Color      initinalStoneColor    = stone.GetComponent <SpriteRenderer>().color;
                Vector3    targetPosition        = MissionData.GetCameraPosition(MissionManager.Instance.mCurLevel,
                                                                                 MissionManager.Instance.mCurSubLevel);

                targetPosition.y += 6.5f;

                //stone.GetComponent<SpriteRenderer>().DOColor(new Color(0, 0, 0, 0), 1.0f);
                //石头要变成Trigger,不然在飞行的过程中撞到Player会导致Player死亡
                stone.gameObject.GetComponent <PolygonCollider2D>().isTrigger = true;
                stone.gameObject.transform.DOMove(targetPosition, 1.0f).OnComplete(() =>
                {
                    stone.gameObject.SetActive(false);
                    stone.gameObject.GetComponent <PolygonCollider2D>().isTrigger = false;
                    stone.gameObject.transform.position         = initinalStonePosition;
                    stone.GetComponent <SpriteRenderer>().color = initinalStoneColor;
                    //这里要播放炸掉石头的特效
                });
            }

            yield return(new WaitForSeconds(2.5f));

            isAniComplete    = true;
            animator.enabled = false;
            UFO.SetActive(false);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 获得相机初始位置
 /// </summary>
 public Vector3 GetCameraStartPos()
 {
     return(MissionData.GetCameraPosition(mCurLevel, mCurSubLevel));
 }