Example #1
0
        public static void CreateCurvyUISpline(MenuCommand cmd)
        {
            var parent = cmd.context as GameObject;

            if (!parent || parent.GetComponentInParent <Canvas>() == null)
            {
                var cv = GameObject.FindObjectOfType <Canvas>();
                if (cv)
                {
                    parent = cv.gameObject;
                }
                else
                {
                    parent = new GameObject("Canvas", typeof(Canvas));
                }
            }
            if (Selection.gameObjects.Length > 0 && cmd.context == Selection.gameObjects[0])
            {
                Selection.activeObject = null;
            }
            var spl = CreateCurvyObjectAsChild <CurvyUISpline>(parent, "UI Spline");

            spl.RestrictTo2D = true;
            spl.Orientation  = CurvyOrientation.None;
            DTSelection.AddGameObjects(spl);
        }
Example #2
0
        public static void CreatePathController(MenuCommand cmd)
        {
            if (Selection.gameObjects.Length > 0 && cmd.context == Selection.gameObjects[0])
            {
                Selection.activeObject = null;
            }
            var ct = CreateCurvyObjectAsChild <PathController>(cmd.context, "Controller");

            DTSelection.AddGameObjects(ct);
        }
Example #3
0
        public static void CreateCG(MenuCommand cmd)
        {
            if (Selection.gameObjects.Length > 0 && cmd.context == Selection.gameObjects[0])
            {
                Selection.activeObject = null;
            }
            var cg = CreateCurvyObjectAsChild <CurvyGenerator>(cmd.context, "Generator");

            DTSelection.AddGameObjects(cg);
        }
Example #4
0
        public static void CreateCurvySpline(MenuCommand cmd)
        {
            if (Selection.gameObjects.Length > 0 && cmd.context == Selection.gameObjects[0])
            {
                Selection.activeObject = null;
            }
            var spl = CreateCurvyObjectAsChild <CurvySpline>(cmd.context, "Spline");

            DTSelection.AddGameObjects(spl);
        }