Example #1
0
    public void InitScene()
    {
        curLevel  = CreatLevelLand("level_land_0" + curLevelIndex, new Vector3(0, 0, 0));
        curSpline = curLevel.transform.Find("Wayfinding").GetComponent <CatmullRomSpline3>();

        var _splineLength = curSpline.ParametrizeByArcLength(100);

        maxDistance = curSpline.CalcTotalLength();
    }
Example #2
0
        private void CreateSpiral()
        {
            CatmullRomSpline3 spline = CatmullRomSpline3.Create();
            int points = 1000;

            for (int i = 0; i < points; ++i)
            {
                float   t = i * .1f;
                Vector3 p = .5f * new Vector3(t * Mathf.Cos(t), .5f * t, t * Mathf.Sin(t));
                spline.AddVertexLast(p);
            }
        }
Example #3
0
        private void CreateChildren()
        {
            Transform thisTransform = transform;
            int       childCount    = thisTransform.childCount;

            Vector3[] points = new Vector3[childCount];
            for (int i = 0; i < childCount; ++i)
            {
                points[i] = thisTransform.GetChild(i).position.ToVector2XY();
            }
            CatmullRomSpline3.Create(points, SplineTypes.Open);
        }
Example #4
0
    public void ReadBattle()
    {
        if (curLevelId >= LevelList.Count)
        {
            Debug.Log("游戏通关");
            return;
        }


        ClearData();
        mWay = LoadScene(curLevelId);
        LoadPlayer();
    }
Example #5
0
 private void CreateEmpty()
 {
     CatmullRomSpline3.Create();
 }