Exemplo n.º 1
0
        IEnumerator DrawAllLine()
        {
            yield return(new WaitForSeconds(0.3f));

            starPosition = positions[0].position;
            for (int i = 1; i < positions.Length; i++)
            {
                targetPosition = positions[i].position;
                GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/LineEff")) as GameObject;
                go.transform.parent   = gameObject.transform;
                go.transform.position = starPosition;
                TrailAutoMoveComp t = go.AddComponent <TrailAutoMoveComp>();
                t.Init(targetPosition, lineTime);
                Vector3 nextCameraPosition = new Vector3(targetPosition.x, targetPosition.y, -10);
                mainCamera.transform.DOMove(nextCameraPosition, lineTime);
                starPosition = targetPosition;
                yield return(new WaitForSeconds(lineTime - 0.1f));
            }
            bgImage.gameObject.GetComponent <SpriteRenderer>().DOColor(new Color(1, 1, 1, 1), 5.5f);
            mainCamera.transform.DOMove(new Vector3(0, 0, -10), 4.0f);
            mainCamera.DOOrthoSize(5.0f, 4.0f);

            Vector3 targetScale = new Vector3(mIniCameraBgScale.x * 5, mIniCameraBgScale.y * 5, 1);

            cameraBg.gameObject.transform.DOScale(targetScale, 4.0f);
            yield return(new WaitForSeconds(4.0f));

            mainCamera.DOOrthoSize(1.0f, 4.0f);
            yield return(new WaitForSeconds(3.0f));

            //进入下一个关卡
            GameManagers.mMissionManager.GoToNextLevel();
            yield return(null);
        }
Exemplo n.º 2
0
        private void DrawOneLine(Vector3 starPos, Vector3 targetPos)
        {
            GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/LineEff")) as GameObject;

            go.transform.parent   = gameObject.transform;
            go.transform.position = starPos;
            TrailAutoMoveComp t = go.AddComponent <TrailAutoMoveComp>();

            t.Init(targetPos, lineTime);
        }