示例#1
0
        protected virtual void OnSceneGUI()
        {
            if (initGUI)
            {
                SplineEditorGUI.Initialize();
                initGUI = false;
            }
            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;
                    }
                    SplineEditor.DrawSplineComputer(allComputers[i], SceneView.currentDrawingSceneView.camera, false, false, 0.4f);
                }
                for (int i = 0; i < root.address.depth; i++)
                {
                    if (user.address.elements[i].computer == root.computer)
                    {
                        continue;
                    }
                    SplineEditor.DrawSplineComputer(root.address.elements[i].computer, SceneView.currentDrawingSceneView.camera, false, false, 1f, root.address.elements[i].startPercent, root.address.elements[i].endPercent, false);
                }
            }
            else
            {
                SplineComputer        rootComputer = user.GetComponent <SplineComputer>();
                List <SplineComputer> allComputers = user.computer.GetConnectedComputers();
                for (int i = 0; i < allComputers.Count; i++)
                {
                    if (allComputers[i] == rootComputer)
                    {
                        continue;
                    }
                    SplineEditor.DrawSplineComputer(allComputers[i], SceneView.currentDrawingSceneView.camera, false, false, 0.4f);
                }
                for (int i = 0; i < user.address.depth; i++)
                {
                    if (user.address.elements[i].computer == rootComputer)
                    {
                        continue;
                    }
                    SplineEditor.DrawSplineComputer(user.address.elements[i].computer, SceneView.currentDrawingSceneView.camera, false, false, 1f, user.address.elements[i].startPercent, user.address.elements[i].endPercent, false);
                }
            }
        }
        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();
            }
        }