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); }
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); }
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); }
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); }