Exemple #1
0
        public SplineEditor(Matrix4x4 transformMatrix, string editorName) : base()
        {
            _matrix         = transformMatrix;
            this.editorName = editorName;
            mainModule      = new MainPointModule(this);
            mainModule.onSelectionChanged += OnSelectionChanged;
            List <PointModule> moduleList = new List <PointModule>();

            OnModuleList(moduleList);
            modules              = moduleList.ToArray();
            toolContents         = new GUIContent[modules.Length];
            toolContentsSelected = new GUIContent[modules.Length];
            for (int i = 0; i < modules.Length; i++)
            {
                modules[i].onSelectionChanged += OnSelectionChanged;
                toolContents[i]         = modules[i].GetIconOff();
                toolContentsSelected[i] = modules[i].GetIconOn();
            }
            toolbar = new Toolbar(toolContents, toolContentsSelected, 35f);

            pointOperations.Add(new PointOperation {
                name = "Flat X", action = delegate { FlatSelection(0); }
            });
            pointOperations.Add(new PointOperation {
                name = "Flat Y", action = delegate { FlatSelection(1); }
            });
            pointOperations.Add(new PointOperation {
                name = "Flat Z", action = delegate { FlatSelection(2); }
            });
            pointOperations.Add(new PointOperation {
                name = "Mirror X", action = delegate { MirrorSelection(0); }
            });
            pointOperations.Add(new PointOperation {
                name = "Mirror Y", action = delegate { MirrorSelection(1); }
            });
            pointOperations.Add(new PointOperation {
                name = "Mirror Z", action = delegate { MirrorSelection(2); }
            });
            pointOperations.Add(new PointOperation {
                name = "Distribute Evenly", action = delegate { DistributeEvenly(); }
            });
            pointOperations.Add(new PointOperation {
                name = "Auto Bezier Tangents", action = delegate { AutoTangents(); }
            });

            pointOperationStrings    = new string[pointOperations.Count + 1];
            pointOperationStrings[0] = "Point Operations";
            for (int i = 0; i < pointOperations.Count; i++)
            {
                pointOperationStrings[i + 1] = pointOperations[i].name;
            }
        }
Exemple #2
0
        public SplineEditor(Transform transform, string editorName) : base()
        {
            _transform      = transform;
            this.editorName = editorName;

            mainModule = new MainPointModule(this);
            mainModule.onSelectionChanged += OnSelectionChanged;
            List <PointModule> moduleList = new List <PointModule>();

            OnModuleList(moduleList);
            modules              = moduleList.ToArray();
            toolContents         = new GUIContent[modules.Length];
            toolContentsSelected = new GUIContent[modules.Length];
            for (int i = 0; i < modules.Length; i++)
            {
                modules[i].onSelectionChanged += OnSelectionChanged;
                toolContents[i]         = modules[i].GetIconOff();
                toolContentsSelected[i] = modules[i].GetIconOn();
            }
            toolbar = new Toolbar(toolContents, toolContentsSelected, 35f);
        }