public override void OnInspectorGUI()
        {
            var component = (TestComponent)target;

            if (component.IsTestGroup())
            {
                component.name = EditorGUILayout.TextField(guiTestName, component.name);
                serializedObject.ApplyModifiedProperties();
                TestManager.InvalidateTestList();
                return;
            }

            serializedObject.Update();
            if (!serializedObject.isEditingMultipleObjects)
            {
                component.name = EditorGUILayout.TextField(guiTestName, component.name);
                component.includedPlatforms = (TestComponent.IncludedPlatforms)EditorGUILayout.EnumMaskField(guiIncludePlatforms, component.includedPlatforms, EditorStyles.popup);
            }
            EditorGUILayout.PropertyField(timeout, guiTimeout);
            EditorGUILayout.PropertyField(ignored, guiIgnore);
            EditorGUILayout.PropertyField(succeedAssertions, guiSuccedOnAssertions);
            EditorGUILayout.PropertyField(expectException, guiExpectException);

            EditorGUI.BeginDisabledGroup(!expectException.boolValue);
            EditorGUILayout.PropertyField(expectedExceptionList, guiExpectExceptionList);
            EditorGUILayout.PropertyField(succeedWhenExceptionIsThrown, guiSucceedWhenExceptionIsThrown);
            EditorGUI.EndDisabledGroup();

            if (serializedObject.ApplyModifiedProperties() || GUI.changed)
            {
                TestManager.InvalidateTestList();
            }
        }
示例#2
0
 void DrawCore()
 {
     graph.autoRefresh     = EditorGUILayout.Toggle("Auto Refresh", graph.autoRefresh);
     graph.graphType       = (WMG_Axis_Graph.graphTypes)EditorGUILayout.EnumPopup("Graph Type", graph.graphType);
     graph.orientationType = (WMG_Axis_Graph.orientationTypes)EditorGUILayout.EnumPopup("Orientation Type", graph.orientationType);
     graph.axesType        = (WMG_Axis_Graph.axesTypes)EditorGUILayout.EnumPopup("Axes Type", graph.axesType);
     graph.resizeType      = (WMG_Axis_Graph.resizeTypes)EditorGUILayout.EnumPopup("Resize Type", graph.resizeType);
             #if !UNITY_2017_3_OR_NEWER
     graph.resizeProperties = (WMG_Axis_Graph.ResizeProperties)EditorGUILayout.EnumMaskField("Resize Properties", graph.resizeProperties);
             #else
     graph.resizeProperties = (WMG_Axis_Graph.ResizeProperties)EditorGUILayout.EnumFlagsField("Resize Properties", graph.resizeProperties);
             #endif
     graph.useGroups      = EditorGUILayout.Toggle("Use Groups", graph.useGroups);
     graph.groupsCentered = EditorGUILayout.Toggle("Groups Centered", graph.groupsCentered);
     ArrayGUI("Groups", "groups");
     ArrayGUI("Series", "lineSeries");
     graph.paddingLeftRight       = EditorGUILayout.Vector2Field("Padding Left Right", graph.paddingLeftRight);
     graph.paddingTopBottom       = EditorGUILayout.Vector2Field("Padding Top Bottom", graph.paddingTopBottom);
     graph.theOrigin              = EditorGUILayout.Vector2Field("The Origin", graph.theOrigin);
     graph.barWidth               = EditorGUILayout.FloatField("Bar Width", graph.barWidth);
     graph.barAxisValue           = EditorGUILayout.FloatField("Bar Axies Value", graph.barAxisValue);
     graph.autoUpdateOrigin       = EditorGUILayout.Toggle("Auto Update Origin", graph.autoUpdateOrigin);
     graph.autoUpdateBarWidth     = EditorGUILayout.Toggle("Auto Update Bar Width", graph.autoUpdateBarWidth);
     graph.autoUpdateBarAxisValue = EditorGUILayout.Toggle("Auto Update Bar Axis Value", graph.autoUpdateBarAxisValue);
 }
    public static BulletSharp.CollisionFilterGroups RenderEnumMaskCollisionFilterGroupsField(GUIContent guiContent, BulletSharp.CollisionFilterGroups enumVal)
    {
        GUICollisionFilterGroups g = ConvertBulletSharpEnumToGUIEnum_CollisionFilterGroups(enumVal);

        g = (GUICollisionFilterGroups)EditorGUILayout.EnumMaskField(guiContent, g);
        return(ConvertGUIEnumToBulletSharpEnum_CollisionFilterGroups(g));
    }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            TilesetBrush brush = (TilesetBrush)target;

            if (brush.Tileset == null)
            {
                EditorGUILayout.HelpBox("Select a tileset first", MessageType.Info);
                EditorGUILayout.PropertyField(m_tileset);
                serializedObject.ApplyModifiedProperties();
                return;
            }

            EditorGUILayout.PropertyField(m_tileset);
            EditorGUILayout.PropertyField(m_showInPalette);
            m_group.intValue = TilesetEditor.DoGroupFieldLayout(brush.Tileset, "Group", m_group.intValue);
            string sAutotilingModeTooltip =
                "Autotiling Mode:\n" +
                "Self: autotile only with brushes of same type\n" +
                "Other: autotile with any other not empty tile\n" +
                "Group: autotile with brushes of a group that autotile the brush group";

            m_autotilingMode.intValue = System.Convert.ToInt32(EditorGUILayout.EnumMaskField(new GUIContent("Autotiling Mode", sAutotilingModeTooltip), brush.AutotilingMode));

            if (GUI.changed)
            {
                serializedObject.ApplyModifiedProperties();
                EditorUtility.SetDirty(target);
            }
        }
示例#5
0
    static void ShortcutEditPanel()
    {
        GUILayout.BeginArea(shortcutEditRect);

        // descriptionTitleRect = EditorGUI.RectField(new Rect(240,150,200,50), descriptionTitleRect);
        GUILayout.Label("Key", EditorStyles.boldLabel);
        KeyCode key = defaultShortcuts[shortcutIndex].key;

        key = (KeyCode)EditorGUILayout.EnumPopup(key);
        defaultShortcuts[shortcutIndex].key = key;

        GUILayout.Label("Modifiers", EditorStyles.boldLabel);
        // EnumMaskField returns a bit-mask where the flags correspond to the indices of the enum, not the enum values,
        // so this isn't technically correct.
#if UNITY_2017_3_OR_NEWER
        EventModifiers em = (EventModifiers)defaultShortcuts[shortcutIndex].eventModifiers;
        defaultShortcuts[shortcutIndex].eventModifiers = (EventModifiers)EditorGUILayout.EnumFlagsField(em);
#else
        EventModifiers em = (EventModifiers)(((int)defaultShortcuts[shortcutIndex].eventModifiers) * 2);
        em = (EventModifiers)EditorGUILayout.EnumMaskField(em);
        defaultShortcuts[shortcutIndex].eventModifiers = (EventModifiers)(((int)em) / 2);
#endif
        GUILayout.Label("Description", EditorStyles.boldLabel);

        GUILayout.Label(defaultShortcuts[shortcutIndex].description, EditorStyles.wordWrappedLabel);

        GUILayout.EndArea();
    }
    public static BulletSharp.CollisionFlags RenderEnumMaskCollisionFlagsField(GUIContent guiContent, BulletSharp.CollisionFlags enumVal)
    {
        GUICollisionFlags g = (GUICollisionFlags)enumVal;

        g = (GUICollisionFlags)EditorGUILayout.EnumMaskField(guiContent, g);
        return((BulletSharp.CollisionFlags)g);
    }
示例#7
0
        /// <summary>
        /// Raises the inspector GU event.
        /// </summary>
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            serializedObject.Update();

            // 継承先プロパティの描画.
            DrawCustomInspector();
            GUILayout.Space(10);

            // イベントタイプ.
            var spType  = serializedObject.FindProperty("m_EventType");
            int oldType = spType.intValue;

            spType.intValue = (int)((EventType)EditorGUILayout.EnumMaskField(new GUIContent("Event Type"), (EventType)spType.intValue));

            // イベントタイプに合わせて、必要ななイベントのみ詳細を描画.
            foreach (EventType e in System.Enum.GetValues(typeof(EventType)))
            {
                // イベントが有効化されているとき、イベント詳細を描画.
                if (0 < (spType.intValue & (int)e))
                {
                    callbackDrawers[e]();
                }
                // イベントが無効化された場合、設定されているコールバックをリセット.
                else if (0 < (oldType & (int)e))
                {
                    eventProperties[e].FindPropertyRelative("m_PersistentCalls").FindPropertyRelative("m_Calls").ClearArray();
                }
            }
            serializedObject.ApplyModifiedProperties();
        }
示例#8
0
        private void OnGUI()
        {
            if (GUILayout.Button("标记"))
            {
                SetPackingTagAndAssetBundle();
            }

            if (GUILayout.Button("清除标记"))
            {
                ClearPackingTagAndAssetBundle();
            }

            this.platformType            = (PlatformType)EditorGUILayout.EnumPopup(platformType);
            this.isBuildExe              = EditorGUILayout.Toggle("是否打包EXE: ", this.isBuildExe);
            this.isContainAB             = EditorGUILayout.Toggle("是否同将资源打进EXE: ", this.isContainAB);
            this.buildOptions            = (BuildOptions)EditorGUILayout.EnumMaskField("BuildOptions(可多选): ", this.buildOptions);
            this.buildAssetBundleOptions = (BuildAssetBundleOptions)EditorGUILayout.EnumMaskField("BuildAssetBundleOptions(可多选): ", this.buildAssetBundleOptions);

            if (GUILayout.Button("开始打包"))
            {
                if (this.platformType == PlatformType.None)
                {
                    Log.Error("请选择打包平台!");
                    return;
                }
                BuildHelper.Build(this.platformType, this.buildAssetBundleOptions, this.buildOptions, this.isBuildExe, this.isContainAB);
            }
        }
示例#9
0
        internal override void OnGUI(Rect rect, Event current)
        {
            GitSettingsJson settings = GitManager.Settings;

            if (settings == null)
            {
                return;
            }

            EditorGUI.BeginChangeCheck();
            settings.ExternalsType = (GitSettings.ExternalsTypeEnum)EditorGUILayout.EnumMaskField(GitGUI.GetTempContent("External Program Uses", "Use an external program for more advanced features like pushing, pulling, merging and so on"), settings.ExternalsType);
            if (EditorGUI.EndChangeCheck())
            {
                settings.MarkDirty();
            }

            EditorGUI.BeginChangeCheck();
            int newSelectedIndex = EditorGUILayout.Popup(GitGUI.GetTempContent("External Program", "The name of the External program to use"), GitExternalManager.SelectedAdapterIndex, GitExternalManager.AdapterNames);

            settings.ExternalProgram = GitExternalManager.AdapterNames[newSelectedIndex].text;
            if (EditorGUI.EndChangeCheck())
            {
                GitExternalManager.SetSelectedAdapter(newSelectedIndex);
                settings.MarkDirty();
            }

            EditorGUILayout.HelpBox("Using external programs is always recommended as UniGit is still in development.", MessageType.Info);
        }
        public override void OnInspectorGUI()
        {
            var executeHandler = (ExecuteHandler)target;

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel(new GUIContent("On Event"));
            executeHandler.ExecuteMethods = (ExecuteMethod)EditorGUILayout.EnumMaskField(executeHandler.ExecuteMethods,
                                                                                         EditorStyles.popup,
                                                                                         GUILayout.ExpandWidth(false));
            EditorGUILayout.EndHorizontal();

            if (executeHandler.IsExecuteMethodSelected(ExecuteMethod.AfterPeriodOfTime))
            {
                DrawOptionsForAfterPeriodOfTime(executeHandler);
            }

            if (executeHandler.IsExecuteMethodSelected(ExecuteMethod.Update))
            {
                DrawOptionsForOnUpdate(executeHandler);
            }

            if (Application.isPlaying)
            {
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();

                if (GUILayout.Button(new GUIContent("Execute Now", "Execute the script immediately.")))
                {
                    executeHandler.Execute();
                }

                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();
            }
        }
示例#11
0
        public object DrawAndGetNewValue(Type memberType, string memberName, object value, object target)
        {
            // handle flag enum by default
            if (memberType.IsDefined(typeof(FlagsAttribute), false))
            {
                return(EditorGUILayout.EnumMaskField(memberName, (Enum)value));
            }

            // handle enum without description by default
            var enumInfo = GetEnumInfo(memberType);

            if (enumInfo == null)
            {
                return(EditorGUILayout.EnumPopup(memberName, (Enum)value));
            }

            int index = Array.IndexOf(enumInfo.valueList, value);

            index = EditorGUILayout.Popup(memberName, index, enumInfo.nameList);

            if (index < 0 || index >= enumInfo.valueList.Length)
            {
                return(value);
            }

            return(enumInfo.valueList[index]);
        }
        public static Enum DrawMask(this Enum current, UnityLabel label = null, GUIStyle style = null, bool indention = true)
        {
            style = style ?? EditorStyles.popup;
            var layout = style.CreateLayout() ?? Class.CreateLayout();

            return(EditorUI.Draw <Enum>(() => EditorGUILayout.EnumMaskField(label, current, style, layout), indention));
        }
        public override void OnInspectorGUI()
        {
            var script = (AssertionComponent)target;

            EditorGUILayout.BeginHorizontal();
            var obj = DrawComparerSelection(script);

            script.checkMethods = (CheckMethod)EditorGUILayout.EnumMaskField(script.checkMethods,
                                                                             EditorStyles.popup,
                                                                             GUILayout.ExpandWidth(false));
            EditorGUILayout.EndHorizontal();

            if (script.IsCheckMethodSelected(CheckMethod.AfterPeriodOfTime))
            {
                DrawOptionsForAfterPeriodOfTime(script);
            }

            if (script.IsCheckMethodSelected(CheckMethod.Update))
            {
                DrawOptionsForOnUpdate(script);
            }

            if (obj)
            {
                EditorGUILayout.Space();

                m_ThisPathSelector.Draw(script.Action.go, script.Action,
                                        script.Action.thisPropertyPath, script.Action.GetAccepatbleTypesForA(),
                                        go =>
                {
                    script.Action.go = go;
                    AssertionExplorerWindow.Reload();
                },
                                        s =>
                {
                    script.Action.thisPropertyPath = s;
                    AssertionExplorerWindow.Reload();
                });

                EditorGUILayout.Space();

                DrawCustomFields(script);

                EditorGUILayout.Space();

                if (script.Action is ComparerBase)
                {
                    DrawCompareToType(script.Action as ComparerBase);
                }
            }
            if (GUI.changed)
            {
#if UNITY_5_3_OR_NEWER
                EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
#else
                EditorApplication.MarkSceneDirty();
#endif
            }
        }
示例#14
0
        internal static Enum EnumMaskField(string title, Enum buildOption)
        {
#if UNITY_2018_1_OR_NEWER
            return(EditorGUILayout.EnumFlagsField(title, buildOption));
#else
            return(EditorGUILayout.EnumMaskField(title, buildOption));
#endif
        }
示例#15
0
        private static Enum EnumField(string label, Enum enumValue)
        {
#if UNITY_2017_3_OR_NEWER
            return(EditorGUILayout.EnumFlagsField(label, enumValue));
#else
            return(EditorGUILayout.EnumMaskField(label, enumValue));
#endif
        }
示例#16
0
        public override void OnInspectorGUI()
        {
            EditorGUIUtility.labelWidth = 100;
            mTarget.EventTypeMask       = (HotfixEventTrigger.TriggerType)EditorGUILayout.EnumMaskField("EventTypeMask: ", mTarget.EventTypeMask);
            EditorGUILayout.PropertyField(mEventObj);

            this.serializedObject.ApplyModifiedProperties();
        }
示例#17
0
        public override void Draw(object input, string name, System.Reflection.PropertyInfo property,
                                  Action <object> setValueCallback)
        {
            Enum enumValue = (Enum)input;

            enumValue = EditorGUILayout.EnumMaskField(name, enumValue);
            setValueCallback(enumValue);
        }
示例#18
0
 public object DrawAndGetNewValue(Type memberType, string memberName, object value, IComponent component)
 {
     if (memberType.IsDefined(typeof(FlagsAttribute), false))
     {
         return(EditorGUILayout.EnumMaskField(memberName, (Enum)value));
     }
     return(EditorGUILayout.EnumPopup(memberName, (Enum)value));
 }
 public override void OnInspectorGUI()
 {
     _obj.ApplyRecursively =
         EditorGUILayout.Toggle("Apply Recursively", _obj.ApplyRecursively);
     _obj.Tags = (T)Enum.ToObject(typeof(T),
                                  EditorGUILayout.EnumMaskField("Tags",
                                                                (Enum)Enum.ToObject(typeof(T), _obj.Tags)));
 }
        public override void OnInspectorGUI()
        {
            m_SerializedZombieDetector.Update();

            m_LoggingOptions.intValue = (int)(ZombieObjectDetector.LoggingOptions)EditorGUILayout.EnumMaskField(
                new GUIContent("Logging Options", "Allows different depths of logging."),
                (ZombieObjectDetector.LoggingOptions)m_LoggingOptions.intValue);

            EditorGUILayout.BeginVertical(GUI.skin.box);

            EditorGUI.indentLevel++;
            m_ShowLoggingOptionDescriptions = EditorGUILayout.Foldout(m_ShowLoggingOptionDescriptions, "Logging Option Descriptions");
            EditorGUI.indentLevel--;

            if (m_ShowLoggingOptionDescriptions)
            {
                DrawOptionDescription("InvalidType", "Logs information about types that are ignored because they can't cause, or be used to detect, zombie objects (int,float etc)");

                DrawOptionDescription("ListBadEqualsImplementations", "Lists all Bad .Equals Implementations that were found causing the object and all its members to be ignored.");

                DrawOptionDescription("ListScannedObjects", "Lists all objects that have had there members checked for zombie objects.");

                DrawOptionDescription("ListScannedStaticMembers", "List of all Static Members that have been checked from there roots.");

                DrawOptionDescription("ZombieCountForEachStaticField", "Individual Zombie Object count for Static field roots.");

                DrawOptionDescription("ZombieStackTrace", "Zombie object stack trace, used to find root to object causeing leaks.");

                DrawOptionDescription("Default Options", "ZombieStackTrace\nZombieCountForEachStaticField.");
            }

            EditorGUILayout.EndVertical();

            EditorGUILayout.PropertyField(m_LogTag);

            DisplayTypeList("Types to scan. Empty to scan all types.", m_TypesToScanStrings, ref m_NameOfTypeToScanToAdd, ref m_HasFailedToAddTypeToScan);

            DisplayTypeList("Types to ignore.", m_IgnoredTypeStrings, ref m_NameOfIgnoredTypeToAdd, ref m_HasFailedToAddIgnoredType);

            EditorGUILayout.PropertyField(m_LogZombieKeyCode, new GUIContent("Zombie Logging Key Code", "Used for logging in builds"));

            EditorGUI.BeginDisabledGroup(!Application.isPlaying || m_ZombieDetector.IsLogging());
            if (Application.isPlaying)
            {
                if (GUILayout.Button("Log Zombies"))
                {
                    m_ZombieDetector.RunZombieObjectDetection();
                }
            }
            else
            {
                GUILayout.Button("Log Zombies (Available during Play)");
            }

            EditorGUI.EndDisabledGroup();

            m_SerializedZombieDetector.ApplyModifiedProperties();
        }
示例#21
0
    void OnGUI()
    {
        if (GUILayout.Button("update list of effects and there properties"))
        {
            updatePosibleEffectsList();
        }
        projectileFilePath = EditorGUILayout.TextField("current path", projectileFilePath);
        if (GUILayout.Button("set prefab location based on selected Folder"))
        {
            projectileFilePath = getPathToSelection();
        }

        GUILayout.Label("Projectile stats");
        projectileName = EditorGUILayout.TextField("Projectile Name", projectileName);

        damage         = EditorGUILayout.FloatField("damage", damage);
        damageType     = (DamageTypes)EditorGUILayout.EnumMaskField("damage type", damageType);
        selectedEffect = EditorGUILayout.Popup(selectedEffect, possibleEffectsListNames);
        if (GUILayout.Button("add effect (applied on contact)"))
        {
            chosenEffects.Add(selectedEffect);
        }

        foreach (int i in chosenEffects)
        {
            EditorGUILayout.LabelField(possibleEffectsList[i].effectClassName);
            for (int x = 0; x < possibleEffectsList[i].propertyName.Length; x++)
            {
                string prameTypeName = possibleEffectsList[i].valueTypeName[x];
                if (prameTypeName == typeof(int).Name)
                {
                    possibleEffectsList[i].value[x] = EditorGUILayout.IntField(possibleEffectsList[i].propertyName[x], int.Parse(possibleEffectsList[i].value[x])).ToString();
                }
                else if (prameTypeName == typeof(float).Name)
                {
                    possibleEffectsList[i].value[x] = EditorGUILayout.FloatField(possibleEffectsList[i].propertyName[x], float.Parse(possibleEffectsList[i].value[x])).ToString();
                }
                else if (prameTypeName == typeof(bool).Name)
                {
                    possibleEffectsList[i].value[x] = EditorGUILayout.Toggle(possibleEffectsList[i].propertyName[x], bool.Parse(possibleEffectsList[i].value[x])).ToString();
                }
                else if (GetEnumType(prameTypeName).IsEnum)
                {
                    Enum enumValue = (Enum)Enum.ToObject(GetEnumType(prameTypeName), possibleEffectsList[i].value[x]);
                    possibleEffectsList[i].value[x] = EditorGUILayout.EnumPopup(prameTypeName, enumValue).ToString();
                }
            }
        }

        projectileSprite = EditorGUILayout.ObjectField(projectileSprite, typeof(Sprite), false) as Sprite;



        if (GUILayout.Button("create projectile prefab"))
        {
            GameObject projectileObject = new GameObject(projectileName);
        }
    }
示例#22
0
        void OnGUI()
        {
            GUILayout.Space(5);

            if (buildingEditor == null) // close the window if we dont have a reference to our building editor window, can happens due to unity compiling scripts.
            {
                Close();
            }

            GUILayout.BeginVertical("Property Creator Editor Window", boxStyle);

            GUILayout.Space(20);

            propertyName   = EditorGUILayout.TextField(new GUIContent("Name :", "What is the name of this property ?, can be used for knowing what that property is being used for."), propertyName);
            positionAnchor = (SocketPositionAnchor)EditorGUILayout.EnumPopup(new GUIContent("Starting Position Anchor :", "Where will it spawn the object in the building local position ? use this to help you position your property faster, it doesnt influence any further features."), positionAnchor);

            if (creatingType == ModifierType.Socket)
            {
                previewGameObject = (GameObject)EditorGUILayout.ObjectField(new GUIContent("Socket Gizmos Preview GameObject :", "This GameObject will be used for preview on gizmos, it will grab the parameters from it into the collider to hlep you easily get your scale right."), previewGameObject, typeof(GameObject), false);
                receivesBuildings = (BuildingType)EditorGUILayout.EnumMaskPopup(new GUIContent("Receive Buildings :", "What building will be snapped into this socket ?"), receivesBuildings);
                socketPlacingType = (PlacingRestrictionType)EditorGUILayout.EnumMaskPopup(new GUIContent("Placing Type :", "What the placing method will be on this socket ?"), socketPlacingType);
            }
            else if (creatingType == ModifierType.Condition)
            {
                condition = EditorGUILayout.ObjectField(new GUIContent("Condition Script :", "What condition script will this condition use ? you can always edit it later. if you leave this blank it will use the BaseCondition script. "), condition, typeof(MonoScript), false) as MonoScript;

                if (condition != null && !condition.GetClass().BaseType.Equals(typeof(BaseCondition))) // reset condition if its type isnt what we need ( a condition ).
                {
                    condition = null;
                }
            }
            else // snap points
            {
                targetType = (BuildingType)EditorGUILayout.EnumMaskField("Target type :", targetType);
            }

            if (GUILayout.Button("Create " + creatingType.ToString()))
            {
                if (creatingType == ModifierType.Socket)
                {
                    buildingEditor.script.CreateSocket(propertyName, positionAnchor, previewGameObject, receivesBuildings, socketPlacingType);
                }
                else if (creatingType == ModifierType.Condition)
                {
                    buildingEditor.script.CreateCondition(propertyName, positionAnchor, condition == null ? typeof(BaseCondition) : condition.GetClass());
                }
                else if (creatingType == ModifierType.SnapPoint)
                {
                    buildingEditor.script.CreateSnapPoint(propertyName, positionAnchor, targetType);
                }

                Close();
            }
            else
            {
                EditorGUILayout.EndVertical();
            }
        }
        public sealed override void RenderField(AIInspectorState state)
        {
            var val = EditorGUILayout.EnumMaskField(_label, _curValue);

            if (!val.Equals(_curValue))
            {
                UpdateValue(val, state);
            }
        }
示例#24
0
        /// <summary>
        /// Overrides Editor.OnInspectorGUI() to create custom Detector Component UI
        /// </summary>
        public override void OnInspectorGUI()
        {
            Detector detector = (Detector)target;

            Undo.RecordObject(detector, "Affdex Setting");
            detector.startOnWake = EditorGUILayout.Toggle("Start on Awake", detector.startOnWake);
            detector.emotions    = (Emotions)EditorGUILayout.EnumMaskField("Emotions", detector.emotions);
            detector.expressions = (Expressions)EditorGUILayout.EnumMaskField("Expressions", detector.expressions);
        }
示例#25
0
        public static void OnGUI()
        {
            EditorGUILayout.LabelField("Newly Created Segments", EditorStyles.boldLabel);
            newSegmentType = (LevelSegment.Type)EditorGUILayout.EnumPopup("Type", newSegmentType);
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Extrusion Defaults", EditorStyles.boldLabel);
#if UNITY_2017_4_OR_NEWER
            extrudeBoundsInclusion = (ExtrusionSettings.BoundsInclusion)EditorGUILayout.EnumFlagsField("Bounds Inclusion", extrudeBoundsInclusion);
#else
            extrudeBoundsInclusion = (ExtrusionSettings.BoundsInclusion)EditorGUILayout.EnumMaskField("Bounds Inclusion", extrudeBoundsInclusion);
#endif
            extrudeApplyRotation = EditorGUILayout.Toggle("Apply Rotation", extrudeApplyRotation);
            extrudeApplyScale    = EditorGUILayout.Toggle("Apply Scale", extrudeApplyScale);
            extrudeBendSprite    = EditorGUILayout.Toggle("Extrude Meshes", extrudeBendSprite);
            if (extrudeBendSprite)
            {
                extrudeApplyMeshColors = EditorGUILayout.Toggle("Apply Mesh Colors", extrudeApplyMeshColors);
            }
            extrudeMeshColliderHandle = (ExtrusionSettings.MeshColliderHandling)EditorGUILayout.EnumPopup("Mesh Collider Handling", extrudeMeshColliderHandle);
#if DREAMTECK_SPLINES
            extrudeExtrudeSpline = EditorGUILayout.Toggle("Extrude Splines", extrudeExtrudeSpline);
#endif
            EditorGUILayout.Space();
            EditorGUILayout.LabelField("Editor Handles", EditorStyles.boldLabel);
            debugAlpha         = EditorGUILayout.Slider("Alpha", debugAlpha, 0.1f, 1f);
            debugPointColor    = EditorGUILayout.ColorField("Point Visualization Color", debugPointColor);
            debugEntranceColor = EditorGUILayout.ColorField("Entrance Visualization Color", debugEntranceColor);
            debugExitColor     = EditorGUILayout.ColorField("Exit Visualization Color", debugExitColor);
            EditorGUILayout.LabelField("Editor GUI", EditorStyles.boldLabel);
            highlightColor        = EditorGUILayout.ColorField("Highlight color", highlightColor);
            highlightContentColor = EditorGUILayout.ColorField("Highlight content color", highlightContentColor);

            if (GUILayout.Button("Use Defaults", GUILayout.Width(120)))
            {
                newSegmentType            = LevelSegment.Type.Extruded;
                debugPointColor           = Color.black;
                debugEntranceColor        = new Color(0f, 0.887f, 0.106f, 1f);
                debugExitColor            = new Color(0.887f, 0f, 0.25f, 1f);
                highlightColor            = new Color(0.4117647f, 0.8705883f, 0.007843138f, 1f);
                highlightContentColor     = new Color(1f, 1f, 1f, 0.95f);
                extrudeApplyScale         = false;
                extrudeApplyRotation      = true;
                extrudeBendSprite         = false;
                extrudeApplyMeshColors    = false;
                extrudeBoundsInclusion    = (ExtrusionSettings.BoundsInclusion) ~0;
                extrudeMeshColliderHandle = ExtrusionSettings.MeshColliderHandling.Bypass;
#if DREAMTECK_SPLINES
                extrudeExtrudeSpline = false;
#endif
                SavePrefs();
            }
            if (GUI.changed)
            {
                SavePrefs();
            }
        }
示例#26
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override System.Enum DrawAndUpdateValue()
        {
            if (m_cachedValue == null)
            {
                // Throw some kind of exception here? this value should always be initialized...
                return(null);
            }

            return(EditorGUILayout.EnumMaskField(Label, m_cachedValue, options));
        }
示例#27
0
        protected override void OnGUIValue()
        {
            var _value = (System.Enum)(CachedValue ?? System.Activator.CreateInstance(this.MemberType));
            var val    = _isFlags ? EditorGUILayout.EnumMaskField(_value) : EditorGUILayout.EnumPopup(_value);

            if (val != _value)
            {
                SetValue(val);
            }
        }
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            serializedObject.Update();

            targetFaction.intValue = (int)((Faction)EditorGUILayout.EnumMaskField("Target Faction", (Faction)targetFaction.intValue));

            serializedObject.ApplyModifiedProperties();
        }
示例#29
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            EditorGUILayout.PropertyField(serializedObject.FindProperty("operation"));
            staticFlagMask.intValue = (int)((VRTK_PolicyList.CheckTypes)EditorGUILayout.EnumMaskField("Check Types", (VRTK_PolicyList.CheckTypes)staticFlagMask.intValue));
            ArrayGUI(identifiers);

            serializedObject.ApplyModifiedProperties();
        }
示例#30
0
    protected virtual void OnIsResizableFadeGroup()
    {
        var resizeHandleAnchors = serializedObject.FindProperty("ResizeHandleAnchors");

        resizeHandleAnchors.intValue =
            (int)(ChatPanelUI.ResizeAnchor)EditorGUILayout.EnumMaskField("Resize Handle Anchors",
                                                                         (ChatPanelUI.ResizeAnchor)resizeHandleAnchors.intValue);

        EditorGUILayout.PropertyField(serializedObject.FindProperty("ResizeHandleSize"));
    }