-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attributes persistence and many fixes
Attribute as ScriptableObject for data persistence Creating asset files for attributes Fixed: attribute editor Fixed: saving attributes in Specialized Class and Characters Fixed: saving values in attributes Fixed: changing order of attributes changes references Fixed: character and specialized class visual issues
- Loading branch information
Showing
10 changed files
with
169 additions
and
69 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEditor; | ||
using UnityEditorInternal; | ||
using UnityEngine; | ||
|
||
[CustomEditor(typeof(Attribute))] | ||
public class AttributeEditor : Editor { | ||
|
||
public bool foldout; | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
Rect rectL = EditorGUILayout.GetControlRect(); | ||
Attribute attribute = (Attribute) target; | ||
var textDimensions = GUI.skin.label.CalcSize(new GUIContent(attribute.name)); | ||
|
||
foldout = EditorGUI.Foldout(new Rect(rectL.x, rectL.y, textDimensions.x + 5, rectL.height), foldout, attribute.name); | ||
if (foldout) | ||
{ | ||
rectL.height = EditorGUIUtility.singleLineHeight; | ||
rectL.x += 15; | ||
rectL.y += EditorGUIUtility.singleLineHeight; | ||
EditorGUI.PropertyField(rectL, serializedObject.FindProperty("name")); | ||
rectL.y += EditorGUIUtility.singleLineHeight; | ||
EditorGUI.PropertyField(rectL, serializedObject.FindProperty("id")); | ||
rectL.y += EditorGUIUtility.singleLineHeight; | ||
EditorGUI.PropertyField(rectL, serializedObject.FindProperty("description")); | ||
rectL.y += EditorGUIUtility.singleLineHeight; | ||
EditorGUI.PropertyField(rectL, serializedObject.FindProperty("isCore")); | ||
} | ||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters