Пример #1
0
        public override void OnInspectorGUI()
        {
            CustomUtilities.DrawScriptableObjectField <CharacterActionsAsset>((CharacterActionsAsset)target);

            serializedObject.Update();

            EditorGUILayout.PropertyField(boolActions, true);
            EditorGUILayout.PropertyField(floatActions, true);
            EditorGUILayout.PropertyField(vector2Actions, true);

            CustomUtilities.DrawEditorLayoutHorizontalLine(Color.gray);

            EditorGUILayout.HelpBox(
                "Click the button to replace the original \"CharacterActions.cs\" file. This can be useful if you need to create custom actions, without modifing the code. ",
                MessageType.Info
                );

            if (GUILayout.Button("Create actions"))
            {
                bool result = EditorUtility.DisplayDialog(
                    "Create actions",
                    "Warning: This will replace the original \"CharacterActions\" file. Are you sure you want to continue?", "Yes", "No");

                if (result)
                {
                    CreateCSharpClass();
                }
            }

            serializedObject.ApplyModifiedProperties();
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            CustomUtilities.DrawScriptableObjectField <MaterialsProperties>((MaterialsProperties)target);

            CustomUtilities.DrawEditorLayoutHorizontalLine(Color.gray, 8);
            EditorGUILayout.LabelField("Default material", EditorStyles.boldLabel);

            EditorGUILayout.HelpBox("A default material parameter corresponds to any ground or spatial volume without a specific \"material tag\". " +
                                    "A Surface affects grounded movement, while a Volume affects not grounded movement.", MessageType.Info);
            GUILayout.Space(10);

            CustomUtilities.DrawEditorLayoutHorizontalLine(Color.gray);

            EditorGUILayout.LabelField("Default surface", EditorStyles.boldLabel);
            CustomUtilities.DrawArrayElement(defaultSurface, null, true);

            CustomUtilities.DrawEditorLayoutHorizontalLine(Color.gray);

            EditorGUILayout.LabelField("Default volume", EditorStyles.boldLabel);
            CustomUtilities.DrawArrayElement(defaultVolume, null, true);

            // --------------------------------------------------------------------------------------------------------

            GUILayout.Space(10);



            CustomUtilities.DrawEditorLayoutHorizontalLine(Color.gray);


            EditorGUILayout.LabelField("Tagged materials", EditorStyles.boldLabel);
            GUILayout.Space(10);


            CustomUtilities.DrawEditorLayoutHorizontalLine(Color.gray, 8);
            EditorGUILayout.LabelField("Surfaces", EditorStyles.boldLabel);

            CustomUtilities.DrawArray(surfaces, "tagName");


            CustomUtilities.DrawEditorLayoutHorizontalLine(Color.gray, 8);

            EditorGUILayout.LabelField("Volumes", EditorStyles.boldLabel);

            CustomUtilities.DrawArray(volumes, "tagName");



            serializedObject.ApplyModifiedProperties();
        }