void LoadPrimitives() { RecordUndo("Spline Primitive"); List <Type> types = FindDerivedClasses.GetAllDerivedClasses(typeof(PrimitiveEditor)); primitiveEditors = new PrimitiveEditor[types.Count]; int count = 0; primitiveNames = new string[types.Count]; foreach (Type t in types) { primitiveEditors[count] = (PrimitiveEditor)Activator.CreateInstance(t); primitiveNames[count] = primitiveEditors[count].GetName(); count++; } if (selectedPrimitive >= 0 && selectedPrimitive < primitiveEditors.Length) { ClearSelection(); primitiveEditors[selectedPrimitive].Open(dsEditor); primitiveEditors[selectedPrimitive].Update(); TransformPoints(); FramePoints(); } }
void GetPrimitives() { List <Type> types = FindDerivedClasses.GetAllDerivedClasses(typeof(PrimitiveEditor)); primitives = new PrimitiveEditor[types.Count]; int count = 0; foreach (Type t in types) { primitives[count] = (PrimitiveEditor)Activator.CreateInstance(t); primitives[count].Init(computer); count++; } }
static void Init() { SplineToolsWindow window = (SplineToolsWindow)EditorWindow.GetWindow(typeof(SplineToolsWindow)); window.name = "Spline tools"; List <Type> types = FindDerivedClasses.GetAllDerivedClasses(typeof(ISplineTool)); tools = new ISplineTool[types.Count]; int count = 0; foreach (Type t in types) { tools[count] = (ISplineTool)Activator.CreateInstance(t); count++; } window.Show(); }
private void Awake() { titleContent = new GUIContent("Spline Tools"); name = "Spline tools"; autoRepaintOnSceneChange = true; List <Type> types = FindDerivedClasses.GetAllDerivedClasses(typeof(SplineTool)); tools = new SplineTool[types.Count]; int count = 0; foreach (Type t in types) { tools[count] = (SplineTool)Activator.CreateInstance(t); count++; } if (toolIndex >= 0 && toolIndex < tools.Length) { tools[toolIndex].Open(this); } }
void GetPrimitives() { List <Type> types = FindDerivedClasses.GetAllDerivedClasses(typeof(PrimitiveEditor)); primitives = new PrimitiveEditor[types.Count]; int count = 0; foreach (Type t in types) { primitives[count] = (PrimitiveEditor)Activator.CreateInstance(t); if (primitives[count] == null) { Debug.Log("NULL " + t); } else { primitives[count].Init(splineEditor.computer); } count++; } }
private void OnEnable() { titleContent = new GUIContent("New Path Generator"); generatorTypes = FindDerivedClasses.GetAllDerivedClasses(typeof(LevelPathGenerator)).ToArray(); }
private void OnEnable() { titleContent = new GUIContent("New Segment Shuffle"); randomizerTypes = FindDerivedClasses.GetAllDerivedClasses(typeof(SegmentShuffle)).ToArray(); }
private void OnEnable() { titleContent = new GUIContent("New Custom Sequence"); sequenceTypes = FindDerivedClasses.GetAllDerivedClasses(typeof(CustomSequence)).ToArray(); }