Esempio n. 1
0
        protected override void OnSettingsGUI()
        {
            GUILayout.Label("Mirror Settings", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("Mirror objects on the selected axes.\n\nIf Duplicate is toggled a new object will be instantiated from the selection and mirrored, or if disabled the selection will be moved.", MessageType.Info);

            MirrorSettings scale = m_MirrorAxes;

            bool x = (scale & MirrorSettings.X) != 0 ? true : false;
            bool y = (scale & MirrorSettings.Y) != 0 ? true : false;
            bool z = (scale & MirrorSettings.Z) != 0 ? true : false;
            bool d = (scale & MirrorSettings.Duplicate) != 0 ? true : false;

            EditorGUI.BeginChangeCheck();

            x = EditorGUILayout.Toggle("X", x);
            y = EditorGUILayout.Toggle("Y", y);
            z = EditorGUILayout.Toggle("Z", z);
            d = EditorGUILayout.Toggle("Duplicate", d);

            if (EditorGUI.EndChangeCheck())
            {
                m_MirrorAxes.SetValue((MirrorSettings)
                                      (x ? MirrorSettings.X : 0) |
                                      (y ? MirrorSettings.Y : 0) |
                                      (z ? MirrorSettings.Z : 0) |
                                      (d ? MirrorSettings.Duplicate : 0));
            }

            GUILayout.FlexibleSpace();

            if (GUILayout.Button("Mirror"))
            {
                EditorUtility.ShowNotification(DoAction().notification);
            }
        }