Пример #1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        PointManager myScript = (PointManager)target;

        /**
         *  @brief Create new wayPoint
         */
        if (GUILayout.Button("Create point"))
        {
            Vector3 Temp = Vector3.zero;
            if (BezierCurve2.points.Length > 1)
            {
                Temp = BezierCurve2.points[BezierCurve2.points.Length - 1] - (BezierCurve2.points[BezierCurve2.points.Length - 1] - BezierCurve2.points[0]) * 0.5f;
                Temp = Temp * 0.1f;
            }

            myScript.AddNewPoints(Temp, BezierCurve2.points.Length, MainPoints.pointType.FixedPoint);
        }

        /**
         *  @brief Create Track Line
         */
        if (GUILayout.Button("Create line"))
        {
            BezierCurve2.CruveSteps = myScript.curveSteps;
            BezierCurve2.ClearAllData();
            BezierCurve2.IncreaseSize(myScript.startSize);
            BezierCurve2.updateCurvePoints();
            BezierCurve2.CalcAllTrackPointData();
            myScript.DrawLine_Edtior();
        }

        /**
         *  @brief Save Track Data
         */
        if (GUILayout.Button("Save Track Point Data"))
        {
            BezierCurve2.SaveTrackPointData(myScript.CurrentLevel);
        }

        /**
         *  @brief Load Track Data and Create Track Line
         */
        if (GUILayout.Button("Load Track Point Data && Create Line"))
        {
            BezierCurve2.LoadTrackPointData(myScript.CurrentLevel);
            myScript.DrawLine_Edtior();
        }
    }
Пример #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        TrackMeshGenerate myScript = (TrackMeshGenerate)target;

        /**
         *  @brief Generate Track Mesh individual parts
         */
        if (GUILayout.Button("Generate Track Mesh (many Parts)"))
        {
            BezierCurve2.LoadTrackPointData(myScript.Current_Level);
            myScript.GenerateMesh2();
        }

        /**
         *  @brief Generate Track Mesh in whole
         */
        if (GUILayout.Button("Generate Track Mesh(one P)"))
        {
            BezierCurve2.LoadTrackPointData(myScript.Current_Level);
            myScript.GenerateMesh();
        }
    }