Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
        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++;
            }
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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++;
            }
        }
Exemplo n.º 6
0
 private void OnEnable()
 {
     titleContent   = new GUIContent("New Path Generator");
     generatorTypes = FindDerivedClasses.GetAllDerivedClasses(typeof(LevelPathGenerator)).ToArray();
 }
Exemplo n.º 7
0
 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();
 }