Ejemplo n.º 1
0
        public ComputerEditor(SplineComputer[] splines, SerializedObject serializedObject, DreamteckSplinesEditor pathEditor) : base()
        {
            spline                = splines[0];
            this.splines          = splines;
            this.pathEditor       = pathEditor;
            this.serializedObject = serializedObject;
            modules               = new ComputerEditorModule[2];
            modules[0]            = new ComputerMergeModule(spline);
            modules[1]            = new ComputerSplitModule(spline);
            GUIContent[] utilityContents = new GUIContent[modules.Length], utilityContentsSelected = new GUIContent[modules.Length];
            for (int i = 0; i < modules.Length; i++)
            {
                utilityContents[i]         = modules[i].GetIconOff();
                utilityContentsSelected[i] = modules[i].GetIconOn();
                modules[i].undoHandler    += OnRecordUndo;
                modules[i].repaintHandler += OnRepaint;
            }
            utilityToolbar         = new Dreamteck.Editor.Toolbar(utilityContents, utilityContentsSelected, 35f);
            utilityToolbar.newLine = false;


            int index = 0;

            GUIContent[] transformContents = new GUIContent[4], transformContentsSelected = new GUIContent[4];
            transformContents[index]           = new GUIContent("OFF");
            transformContentsSelected[index++] = new GUIContent("OFF");

            transformContents[index]           = EditorGUIUtility.IconContent("MoveTool");
            transformContentsSelected[index++] = EditorGUIUtility.IconContent("MoveTool On");

            transformContents[index]           = EditorGUIUtility.IconContent("RotateTool");
            transformContentsSelected[index++] = EditorGUIUtility.IconContent("RotateTool On");

            transformContents[index]         = EditorGUIUtility.IconContent("ScaleTool");
            transformContentsSelected[index] = EditorGUIUtility.IconContent("ScaleTool On");

            transformToolbar         = new Dreamteck.Editor.Toolbar(transformContents, transformContentsSelected, 35f);
            transformToolbar.newLine = false;

            index = 0;
            GUIContent[] operationContents = new GUIContent[3], operationContentsSelected = new GUIContent[3];
            for (int i = 0; i < operationContents.Length; i++)
            {
                operationContents[i]         = new GUIContent("");
                operationContentsSelected[i] = new GUIContent("");
            }
            operationsToolbar         = new Dreamteck.Editor.Toolbar(operationContents, operationContentsSelected, 64f);
            operationsToolbar.newLine = false;
        }
Ejemplo n.º 2
0
 public SplineCompEditor(SplineComputer[] splines, SerializedObject serializedObject, DreamteckSplinesEditor pathEditor) : base()
 {
     spline                = splines[0];
     this.splines          = splines;
     this.pathEditor       = pathEditor;
     this.serializedObject = serializedObject;
     modules               = new ComputerEditorModule[2];
     modules[0]            = new ComputerMergeModule(spline);
     modules[1]            = new ComputerSplitModule(spline);
     GUIContent[] toolbarContents = new GUIContent[modules.Length], toolbarContentsSelected = new GUIContent[modules.Length];
     for (int i = 0; i < modules.Length; i++)
     {
         toolbarContents[i]         = modules[i].GetIconOff();
         toolbarContentsSelected[i] = modules[i].GetIconOn();
         modules[i].undoHandler    += OnRecordUndo;
         modules[i].repaintHandler += OnRepaint;
     }
     toolbar         = new Dreamteck.Editor.Toolbar(toolbarContents, toolbarContentsSelected, 35f);
     toolbar.newLine = false;
 }
Ejemplo n.º 3
0
        public ComputerEditor(SplineComputer[] splines, SerializedObject serializedObject, DreamteckSplinesEditor pathEditor) : base()
        {
            spline                = splines[0];
            this.splines          = splines;
            this.pathEditor       = pathEditor;
            this.serializedObject = serializedObject;

            splineProperty            = serializedObject.FindProperty("spline");
            sampleRate                = serializedObject.FindProperty("spline").FindPropertyRelative("sampleRate");
            type                      = serializedObject.FindProperty("spline").FindPropertyRelative("type");
            linearAverageDirection    = splineProperty.FindPropertyRelative("linearAverageDirection");
            space                     = serializedObject.FindProperty("_space");
            sampleMode                = serializedObject.FindProperty("_sampleMode");
            optimizeAngleThreshold    = serializedObject.FindProperty("_optimizeAngleThreshold");
            updateMode                = serializedObject.FindProperty("updateMode");
            rebuildOnAwake            = serializedObject.FindProperty("rebuildOnAwake");
            multithreaded             = serializedObject.FindProperty("multithreaded");
            customNormalInterpolation = splineProperty.FindPropertyRelative("customNormalInterpolation");
            customValueInterpolation  = splineProperty.FindPropertyRelative("customValueInterpolation");


            modules    = new ComputerEditorModule[2];
            modules[0] = new ComputerMergeModule(spline);
            modules[1] = new ComputerSplitModule(spline);
            GUIContent[] utilityContents = new GUIContent[modules.Length], utilityContentsSelected = new GUIContent[modules.Length];
            for (int i = 0; i < modules.Length; i++)
            {
                utilityContents[i]         = modules[i].GetIconOff();
                utilityContentsSelected[i] = modules[i].GetIconOn();
                modules[i].undoHandler    += OnRecordUndo;
                modules[i].repaintHandler += OnRepaint;
            }
            utilityToolbar         = new Dreamteck.Editor.Toolbar(utilityContents, utilityContentsSelected, 35f);
            utilityToolbar.newLine = false;


            int index = 0;

            GUIContent[] transformContents = new GUIContent[4], transformContentsSelected = new GUIContent[4];
            transformContents[index]           = new GUIContent("OFF");
            transformContentsSelected[index++] = new GUIContent("OFF");

            transformContents[index]           = EditorGUIUtility.IconContent("MoveTool");
            transformContentsSelected[index++] = EditorGUIUtility.IconContent("MoveTool On");

            transformContents[index]           = EditorGUIUtility.IconContent("RotateTool");
            transformContentsSelected[index++] = EditorGUIUtility.IconContent("RotateTool On");

            transformContents[index]         = EditorGUIUtility.IconContent("ScaleTool");
            transformContentsSelected[index] = EditorGUIUtility.IconContent("ScaleTool On");

            transformToolbar         = new Dreamteck.Editor.Toolbar(transformContents, transformContentsSelected, 35f);
            transformToolbar.newLine = false;

            index = 0;
            GUIContent[] operationContents = new GUIContent[3], operationContentsSelected = new GUIContent[3];
            for (int i = 0; i < operationContents.Length; i++)
            {
                operationContents[i]         = new GUIContent("");
                operationContentsSelected[i] = new GUIContent("");
            }
            operationsToolbar         = new Dreamteck.Editor.Toolbar(operationContents, operationContentsSelected, 64f);
            operationsToolbar.newLine = false;
        }