Beispiel #1
0
        /// <summary>
        /// Unsubscribe a SplineUser from this computer's updates
        /// </summary>
        /// <param name="input">The SplineUser to unsubscribe</param>
        private void Unsubscribe(SplineUser input)
        {
            int removeSlot = -1;

            for (int i = 0; i < subscribers.Length; i++)
            {
                if (subscribers[i] == input)
                {
                    removeSlot = i;
                    break;
                }
            }
            if (removeSlot < 0)
            {
                return;
            }
            SplineUser[] newSubscribers = new SplineUser[subscribers.Length - 1];
            int          index          = subscribers.Length - 1;

            for (int i = 0; i < subscribers.Length; i++)
            {
                if (index == removeSlot)
                {
                    continue;
                }
                else if (i < index)
                {
                    newSubscribers[i] = subscribers[i];
                }
                else
                {
                    newSubscribers[i - 1] = subscribers[i - 1];
                }
            }
            subscribers = newSubscribers;
        }
        public bool DrawScene(SplineUser user)
        {
            bool         changed = false;
            bool         is2D    = user.rootUser.computer.is2D;
            SplineResult result  = new SplineResult();

            for (int i = 0; i < group.keys.Count; i++)
            {
                if (selected >= 0 && i != selected)
                {
                    continue;
                }
                user.Evaluate(result, group.keys[i].position);
                matrix.SetTRS(result.position, Quaternion.LookRotation(result.direction, result.normal), Vector3.one * result.size);
                Vector3 pos = matrix.MultiplyPoint(group.keys[i].offset);
                if (is2D)
                {
                    Handles.DrawLine(result.position, result.position + result.right * group.keys[i].offset.x * result.size);
                    Handles.DrawLine(result.position, result.position - result.right * group.keys[i].offset.x * result.size);
                }
                else
                {
                    Handles.DrawWireDisc(result.position, result.direction, group.keys[i].offset.magnitude * result.size);
                }
                Handles.DrawLine(result.position, pos);
            }

            if (selected >= 0 && selected < group.keys.Count)
            {
                double value = group.keys[selected].position;
                user.Evaluate(result, value);
                matrix.SetTRS(result.position, Quaternion.LookRotation(result.direction, result.normal), Vector3.one * result.size);
                Vector3 pos = matrix.MultiplyPoint(group.keys[selected].offset);
                if (editOffset)
                {
                    Vector3 lastPos = pos;
                    pos = SplineEditorHandles.FreeMoveRectangle(pos, HandleUtility.GetHandleSize(pos) * 0.1f);
                    if (pos != lastPos)
                    {
                        pos   = matrix.inverse.MultiplyPoint(pos);
                        pos.z = 0f;
                        if (is2D)
                        {
                            group.keys[selected].offset = Vector2.right * pos.x;
                        }
                        else
                        {
                            group.keys[selected].offset = pos;
                        }
                        changed = true;
                    }
                }
                else
                {
                    double lastValue = value;
                    SplineEditorHandles.Slider(user, ref value, user.rootUser.computer.editorPathColor, "Center", SplineEditorHandles.SplineSliderGizmo.Circle, 0.6f);
                    if (value != lastValue)
                    {
                        changed = true;
                    }
                    if (group.keys[selected].from > group.keys[selected].to)
                    {
                        double fromToEndDistance     = 1.0 - group.keys[selected].from;
                        double toToBeginningDistance = group.keys[selected].to;
                        double totalDistance         = fromToEndDistance + toToBeginningDistance;
                        if (value > group.keys[selected].from)
                        {
                            group.keys[selected].center = DMath.InverseLerp(group.keys[selected].from, group.keys[selected].from + totalDistance, value);
                        }
                        else if (value < group.keys[selected].to)
                        {
                            group.keys[selected].center = DMath.InverseLerp(-fromToEndDistance, group.keys[selected].to, value);
                        }
                    }
                    else
                    {
                        group.keys[selected].center = DMath.InverseLerp(group.keys[selected].from, group.keys[selected].to, value);
                    }
                }
                value = group.keys[selected].from;
                SplineEditorHandles.Slider(user, ref value, user.rootUser.computer.editorPathColor, "Start", SplineEditorHandles.SplineSliderGizmo.ForwardTriangle, 1f);
                if (group.keys[selected].from != value)
                {
                    group.keys[selected].from = value;
                    changed = true;
                }

                value = group.keys[selected].to;
                SplineEditorHandles.Slider(user, ref value, user.rootUser.computer.editorPathColor, "End", SplineEditorHandles.SplineSliderGizmo.BackwardTriangle, 1f);
                if (group.keys[selected].to != value)
                {
                    group.keys[selected].to = value;
                    changed = true;
                }
            }
            return(changed);
        }
        protected virtual void HeaderGUI()
        {
            SplineUser user             = (SplineUser)target;
            bool       isTargetComputer = (user.user == null || sampleTarget == SampleTarget.Computer);

            if (user.computer != null && !user.computer.IsSubscribed(user))
            {
                user.computer.Subscribe(user);
            }
            Undo.RecordObject(user, "Inspector Change");

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Spline User", EditorStyles.boldLabel, GUILayout.Width(85));
            GUI.color    = new Color(1f, 1f, 1f, 0.75f);
            sampleTarget = (SampleTarget)EditorGUILayout.EnumPopup(sampleTarget, GUILayout.Width(75));
            GUI.color    = Color.white;
            EditorGUILayout.EndHorizontal();
            if (sampleTarget == SampleTarget.Computer)
            {
                user.computer = (SplineComputer)EditorGUILayout.ObjectField("Computer", user.computer, typeof(SplineComputer), true);
            }
            else
            {
                SplineUser lastUser = user.user;
                user.user = (SplineUser)EditorGUILayout.ObjectField("User", user.user, typeof(SplineUser), true);
                if (lastUser != user.user && user.rootUser == user)
                {
                    user.user = null;
                    EditorUtility.DisplayDialog("Cannot assign user.", "A SplineUser component cannot sample itself, please select another user to sample.", "OK");
                }
            }
            if (user.computer == null && isTargetComputer)
            {
                EditorGUILayout.HelpBox("No SplineComputer or SplineUser is referenced. Reference a SplineComputer or another SplineUser component to make this SplineUser work.", MessageType.Error);
            }

            if (showResolution && isTargetComputer)
            {
                user.resolution = (double)EditorGUILayout.Slider("Resolution", (float)user.resolution, 0f, 1f);
            }
            if (showClip)
            {
                float clipFrom = (float)user.clipFrom;
                float clipTo   = (float)user.clipTo;


                if (user.rootUser.computer != null && user.rootUser.computer.isClosed && user.loopSamples)
                {
                    EditorGUILayout.BeginHorizontal();
                    if (EditButton(_editIndex == 0))
                    {
                        if (_editIndex == 0)
                        {
                            _editIndex = -1;
                        }
                        else
                        {
                            _editIndex = 0;
                        }
                    }
                    EditorGUILayout.BeginVertical();
                    user.clipFrom = EditorGUILayout.Slider("Clip From", (float)user.clipFrom, 0f, 1f);
                    user.clipTo   = EditorGUILayout.Slider("Clip To", (float)user.clipTo, 0f, 1f);
                    EditorGUILayout.EndVertical();
                    EditorGUILayout.EndHorizontal();
                }
                else
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.BeginHorizontal();
                    if (EditButton(_editIndex == 0))
                    {
                        if (_editIndex == 0)
                        {
                            _editIndex = -1;
                        }
                        else
                        {
                            _editIndex = 0;
                        }
                    }
                    EditorGUIUtility.labelWidth = 80f;
                    EditorGUILayout.MinMaxSlider(new GUIContent("Clip Range:"), ref clipFrom, ref clipTo, 0f, 1f);
                    EditorGUIUtility.labelWidth = 0f;
                    EditorGUILayout.EndHorizontal();
                    user.clipFrom = clipFrom;
                    user.clipTo   = clipTo;
                    EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(30));
                    user.clipFrom = EditorGUILayout.FloatField((float)user.clipFrom);
                    user.clipTo   = EditorGUILayout.FloatField((float)user.clipTo);
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.EndHorizontal();
                }
                SplineEditor.hold = _editIndex >= 0;
                if (user.rootUser.computer != null && user.rootUser.computer.isClosed)
                {
                    user.loopSamples = EditorGUILayout.Toggle("Loop Samples", user.loopSamples);
                }
            }

            settings = EditorGUILayout.Foldout(settings, "Settings");
            if (settings)
            {
                EditorGUI.indentLevel++;
                if (showUpdateMethod && isTargetComputer)
                {
                    user.updateMethod = (SplineUser.UpdateMethod)EditorGUILayout.EnumPopup("Update Method", user.updateMethod);
                }
                if (showUniform && (user.user == null || sampleTarget == SampleTarget.Computer))
                {
                    user.uniformSample = EditorGUILayout.Toggle("Unform samples", user.uniformSample);
                    if (user.uniformSample)
                    {
                        user.uniformPreserveClipRange = EditorGUILayout.Toggle("Preserve clip range", user.uniformPreserveClipRange);
                    }
                }
                user.autoUpdate = EditorGUILayout.Toggle("Runtime Auto Update", user.autoUpdate);
                if (showMultithreading)
                {
                    user.multithreaded = EditorGUILayout.Toggle("Multithreading", user.multithreaded);
                }
                user.buildOnAwake  = EditorGUILayout.Toggle("Build on Awake", user.buildOnAwake);
                user.buildOnEnable = EditorGUILayout.Toggle("Build on Enable", user.buildOnEnable);
                EditorGUI.indentLevel--;
            }

            if (user.computer != null && user.computer.nodeLinks.Length > 0 && isTargetComputer)
            {
                if (GUILayout.Button("Edit junction path"))
                {
                    pathWindow = EditorWindow.GetWindow <PathWindow>();
                    pathWindow.Init(this);
                }
            }
        }
        protected virtual void OnSceneGUI()
        {
            SplineUser user = (SplineUser)target;

            if (user.computer == null)
            {
                SplineUser root = user.rootUser;
                if (root == null)
                {
                    return;
                }
                if (root.computer == null)
                {
                    return;
                }
                List <SplineComputer> allComputers = root.computer.GetConnectedComputers();
                for (int i = 0; i < allComputers.Count; i++)
                {
                    if (allComputers[i] == root.computer)
                    {
                        continue;
                    }
                    if (allComputers[i].alwaysDraw)
                    {
                        continue;
                    }
                    SplineDrawer.DrawSplineComputer(allComputers[i], 0.0, 1.0, 0.4f);
                }
                for (int i = 0; i < root.address.depth; i++)
                {
                    SplineDrawer.DrawSplineComputer(root.address.elements[i].computer, root.address.elements[i].startPercent, root.address.elements[i].endPercent, 1f);
                }
            }
            else
            {
                SplineComputer        rootComputer = user.GetComponent <SplineComputer>();
                List <SplineComputer> allComputers = user.computer.GetConnectedComputers();
                for (int i = 0; i < allComputers.Count; i++)
                {
                    if (allComputers[i] == rootComputer && _editIndex == -1)
                    {
                        continue;
                    }
                    if (allComputers[i].alwaysDraw)
                    {
                        continue;
                    }
                    SplineDrawer.DrawSplineComputer(allComputers[i], 0.0, 1.0, 0.4f);
                }
                for (int i = 0; i < user.address.depth; i++)
                {
                    if (user.address.elements[i].computer == rootComputer)
                    {
                        continue;
                    }
                    if (user.address.elements[i].computer.alwaysDraw)
                    {
                        continue;
                    }
                    SplineDrawer.DrawSplineComputer(user.address.elements[i].computer, user.address.elements[i].startPercent, user.address.elements[i].endPercent, 1f);
                }
            }
            if (_editIndex == 0)
            {
                SceneClipEdit();
            }
        }
Beispiel #5
0
        public bool DrawScene(SplineUser user)
        {
            bool         changed = false;
            SplineResult result  = new SplineResult();

            for (int i = 0; i < group.keys.Count; i++)
            {
                if (selected >= 0 && i != selected)
                {
                    continue;
                }
                user.Evaluate(result, group.keys[i].position);
                Quaternion directionRot = Quaternion.LookRotation(result.direction, result.normal);
                Quaternion rot          = directionRot * Quaternion.Euler(group.keys[i].rotation);
                SplineEditorHandles.DrawArrowCap(result.position, rot, HandleUtility.GetHandleSize(result.position));
            }
            if (selected >= 0 && selected < group.keys.Count)
            {
                double value = group.keys[selected].position;
                user.Evaluate(result, value);
                Quaternion directionRot = Quaternion.LookRotation(result.direction, result.normal);
                Quaternion rot          = directionRot * Quaternion.Euler(group.keys[selected].rotation);

                if (editRotation)
                {
                    rot = Handles.RotationHandle(rot, result.position);
                    rot = Quaternion.Inverse(directionRot) * rot;
                    if (rot.eulerAngles != group.keys[selected].rotation)
                    {
                        changed = true;
                    }
                    group.keys[selected].rotation = rot.eulerAngles;
                }
                else
                {
                    double lastValue = value;
                    SplineEditorHandles.Slider(user, ref value, user.rootUser.computer.editorPathColor, "Center", SplineEditorHandles.SplineSliderGizmo.Circle, 0.6f);
                    if (value != lastValue)
                    {
                        changed = true;
                    }
                    if (group.keys[selected].from > group.keys[selected].to)
                    {
                        double fromToEndDistance     = 1.0 - group.keys[selected].from;
                        double toToBeginningDistance = group.keys[selected].to;
                        double totalDistance         = fromToEndDistance + toToBeginningDistance;
                        if (value > group.keys[selected].from)
                        {
                            group.keys[selected].center = DMath.InverseLerp(group.keys[selected].from, group.keys[selected].from + totalDistance, value);
                        }
                        else if (value < group.keys[selected].to)
                        {
                            group.keys[selected].center = DMath.InverseLerp(-fromToEndDistance, group.keys[selected].to, value);
                        }
                    }
                    else
                    {
                        group.keys[selected].center = DMath.InverseLerp(group.keys[selected].from, group.keys[selected].to, value);
                    }
                }

                value = group.keys[selected].from;
                SplineEditorHandles.Slider(user, ref value, user.rootUser.computer.editorPathColor, "Start", SplineEditorHandles.SplineSliderGizmo.ForwardTriangle, 1f);
                if (group.keys[selected].from != value)
                {
                    group.keys[selected].from = value;
                    changed = true;
                }

                value = group.keys[selected].to;
                SplineEditorHandles.Slider(user, ref value, user.rootUser.computer.editorPathColor, "End", SplineEditorHandles.SplineSliderGizmo.BackwardTriangle, 1f);
                if (group.keys[selected].to != value)
                {
                    group.keys[selected].to = value;
                    changed = true;
                }
            }
            return(changed);
        }
Beispiel #6
0
        public static bool DrawTrigger(SplineTrigger trigger, SplineUser user)
        {
            if (trigger == null)
            {
                return(false);
            }
            Camera       cam    = SceneView.currentDrawingSceneView.camera;
            SplineResult result = user.Evaluate(trigger.position);

            Handles.color = trigger.color;
            float   size           = HandleUtility.GetHandleSize(result.position);
            Vector3 center         = result.position;
            Vector2 screenPosition = HandleUtility.WorldToGUIPoint(center);

            screenPosition.y += 20f;
            Vector3 localPos = cam.transform.InverseTransformPoint(center);

            if (localPos.z > 0f)
            {
                Handles.BeginGUI();
                SplineEditorGUI.Label(new Rect(screenPosition.x - 120 + trigger.name.Length * 4, screenPosition.y, 120, 25), trigger.name);
                Handles.EndGUI();
            }
            bool buttonClick = Button(center, false, Color.white, 0.3f);

            Vector3 right = Vector3.Cross(cam.transform.position - result.position, result.direction).normalized *size * 0.1f;

            if (trigger.type == SplineTrigger.Type.Backward)
            {
                center += result.direction * size * 0.06f;
                Vector3 front = center - result.direction * size * 0.2f;
                Handles.DrawLine(center + right, front);
                Handles.DrawLine(front, center - right);
                Handles.DrawLine(center - right, center + right);
            }
            else if (trigger.type == SplineTrigger.Type.Forward)
            {
                center -= result.direction * size * 0.06f;
                Vector3 front = center + result.direction * size * 0.2f;
                Handles.DrawLine(center + right, front);
                Handles.DrawLine(front, center - right);
                Handles.DrawLine(center - right, center + right);
            }
            else
            {
                center += result.direction * size * 0.025f;
                Vector3 front = center + result.direction * size * 0.17f;
                Handles.DrawLine(center + right, front);
                Handles.DrawLine(front, center - right);
                Handles.DrawLine(center - right, center + right);
                center -= result.direction * size * 0.05f;
                front   = center - result.direction * size * 0.17f;
                Handles.DrawLine(center + right, front);
                Handles.DrawLine(front, center - right);
                Handles.DrawLine(center - right, center + right);
            }
            right = Vector3.Cross(cam.transform.position - result.position, result.direction).normalized *size * 0.25f;
            Handles.DrawLine(result.position + right / 2f, result.position + right);
            Handles.DrawLine(result.position - right / 2f, result.position - right);

            Vector3 lastPos = result.position;

            Handles.color   = new Color(Handles.color.r, Handles.color.g, Handles.color.b, 0.5f);
            result.position = Handles.FreeMoveHandle(result.position, Quaternion.LookRotation(cam.transform.position - result.position), size * 0.2f, Vector3.zero, Handles.CircleCap);
            if (result.position != lastPos)
            {
                double projected = user.address.Project(result.position);
                trigger.position = projected;
            }
            Handles.color = Color.white;
            return(buttonClick);
        }
Beispiel #7
0
 protected override void OnInitialize()
 {
     user = (SplineUser)editor.target;
     GetAvailable();
 }
Beispiel #8
0
 public override void init(Editor input, string name, Vector2 minSize)
 {
     base.init(input, name, minSize);
     user = (SplineUser)editor.target;
     GetAvailable();
 }
Beispiel #9
0
        public static bool Slider(SplineUser user, ref double percent, Color color, string text = "", SplineSliderGizmo gizmo = SplineSliderGizmo.Rectangle, float buttonSize = 1f)
        {
            Camera       cam    = SceneView.currentDrawingSceneView.camera;
            SplineResult result = user.Evaluate(percent);
            float        size   = HandleUtility.GetHandleSize(result.position);

            Handles.color = new Color(color.r, color.g, color.b, 0.4f);
            Handles.DrawSolidDisc(result.position, cam.transform.position - result.position, size * 0.2f * buttonSize);
            Handles.color = Color.white;
            if ((color.r + color.g + color.b + color.a) / 4f >= 0.9f)
            {
                Handles.color = Color.black;
            }

            Vector3 center         = result.position;
            Vector2 screenPosition = HandleUtility.WorldToGUIPoint(center);

            screenPosition.y += 20f;
            Vector3 localPos = cam.transform.InverseTransformPoint(center);

            if (text != "" && localPos.z > 0f)
            {
                Handles.BeginGUI();
                DreamteckEditorGUI.Label(new Rect(screenPosition.x - 120 + text.Length * 4, screenPosition.y, 120, 25), text);
                Handles.EndGUI();
            }
            bool    buttonClick  = SliderButton(center, false, Color.white, 0.3f);
            Vector3 lookAtCamera = (cam.transform.position - result.position).normalized;
            Vector3 right        = Vector3.Cross(lookAtCamera, result.direction).normalized *size * 0.1f * buttonSize;
            Vector3 front        = Vector3.forward;

            switch (gizmo)
            {
            case SplineSliderGizmo.BackwardTriangle:
                center += result.direction * size * 0.06f * buttonSize;
                front   = center - result.direction * size * 0.2f * buttonSize;
                Handles.DrawLine(center + right, front);
                Handles.DrawLine(front, center - right);
                Handles.DrawLine(center - right, center + right);
                break;

            case SplineSliderGizmo.ForwardTriangle:
                center -= result.direction * size * 0.06f * buttonSize;
                front   = center + result.direction * size * 0.2f * buttonSize;
                Handles.DrawLine(center + right, front);
                Handles.DrawLine(front, center - right);
                Handles.DrawLine(center - right, center + right);
                break;

            case SplineSliderGizmo.DualArrow:
                center += result.direction * size * 0.025f * buttonSize;
                front   = center + result.direction * size * 0.17f * buttonSize;
                Handles.DrawLine(center + right, front);
                Handles.DrawLine(front, center - right);
                Handles.DrawLine(center - right, center + right);
                center -= result.direction * size * 0.05f * buttonSize;
                front   = center - result.direction * size * 0.17f * buttonSize;
                Handles.DrawLine(center + right, front);
                Handles.DrawLine(front, center - right);
                Handles.DrawLine(center - right, center + right);
                break;

            case SplineSliderGizmo.Rectangle:

                break;

            case SplineSliderGizmo.Circle:
                Handles.DrawWireDisc(center, lookAtCamera, 0.13f * size * buttonSize);
                break;
            }
            Vector3 lastPos = result.position;

            Handles.color = Color.clear;
#if UNITY_5_5_OR_NEWER
            result.position = Handles.FreeMoveHandle(result.position, Quaternion.LookRotation(cam.transform.position - result.position), size * 0.2f * buttonSize, Vector3.zero, Handles.CircleHandleCap);
#else
            result.position = Handles.FreeMoveHandle(result.position, Quaternion.LookRotation(cam.transform.position - result.position), size * 0.2f * buttonSize, Vector3.zero, Handles.CircleCap);
#endif
            if (result.position != lastPos)
            {
                percent = user.Project(result.position).percent;
            }
            Handles.color = Color.white;
            return(buttonClick);
        }
Beispiel #10
0
        public virtual void BaseGUI()
        {
            if (initGUI)
            {
                SplineEditorGUI.Initialize();
                initGUI = false;
            }
            base.OnInspectorGUI();
            SplineUser user             = (SplineUser)target;
            bool       isTargetComputer = (user.user == null || sampleTarget == SampleTarget.Computer);

            if (user.computer != null && !user.computer.IsSubscribed(user))
            {
                user.computer.Subscribe(user);
            }
            Undo.RecordObject(user, "Inspector Change");

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Spline User", EditorStyles.boldLabel, GUILayout.Width(85));
            GUI.color    = new Color(1f, 1f, 1f, 0.75f);
            sampleTarget = (SampleTarget)EditorGUILayout.EnumPopup(sampleTarget, GUILayout.Width(75));
            GUI.color    = Color.white;
            EditorGUILayout.EndHorizontal();
            if (sampleTarget == SampleTarget.Computer)
            {
                user.computer = (SplineComputer)EditorGUILayout.ObjectField("Computer", user.computer, typeof(SplineComputer), true);
            }
            else
            {
                SplineUser lastUser = user.user;
                user.user = (SplineUser)EditorGUILayout.ObjectField("User", user.user, typeof(SplineUser), true);
                if (lastUser != user.user && user.rootUser == user)
                {
                    user.user = null;
                    EditorUtility.DisplayDialog("Cannot assign user.", "A SplineUser component cannot sample itself, please select another user to sample.", "OK");
                }
            }
            if (showUpdateMethod && isTargetComputer)
            {
                user.updateMethod = (SplineUser.UpdateMethod)EditorGUILayout.EnumPopup("Update Method", user.updateMethod);
            }
            if (user.computer == null && isTargetComputer)
            {
                EditorGUILayout.HelpBox("No SplineComputer or SplineUser is referenced. Reference a SplineComputer or another SplineUser component to make this SplineUser work.", MessageType.Error);
            }

            if (showResolution && isTargetComputer)
            {
                user.resolution = (double)EditorGUILayout.Slider("Resolution", (float)user.resolution, 0f, 1f);
            }
            if (showClip)
            {
                EditorGUILayout.BeginHorizontal();
                float clipFrom = (float)user.clipFrom;
                float clipTo   = (float)user.clipTo;
                EditorGUILayout.MinMaxSlider(new GUIContent("Clip Range:"), ref clipFrom, ref clipTo, 0f, 1f);
                user.clipFrom = clipFrom;
                user.clipTo   = clipTo;
                EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(30));
                user.clipFrom = EditorGUILayout.FloatField((float)user.clipFrom);
                user.clipTo   = EditorGUILayout.FloatField((float)user.clipTo);
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.EndHorizontal();
            }
            if (showAveraging && (user.user == null || sampleTarget == SampleTarget.Computer))
            {
                user.averageResultVectors = EditorGUILayout.Toggle("Average Result Vectors", user.averageResultVectors);
            }
            if (showMultithreading)
            {
                user.multithreaded = EditorGUILayout.Toggle("Multithreading", user.multithreaded);
            }

            user.buildOnAwake = EditorGUILayout.Toggle("Build on Awake", user.buildOnAwake);
            if (user.computer != null && user.computer.nodeLinks.Length > 0 && isTargetComputer)
            {
                if (GUILayout.Button("Edit junction path"))
                {
                    pathWindow = EditorWindow.GetWindow <PathWindow>();
                    pathWindow.init(this, "Junction Path", new Vector2(300, 150));
                }
            }
        }