コード例 #1
0
 public SerializedPropertyX(SerializedObjectX serializedObjectX, string fieldName, Type type, object value)
 {
     this.serializedObjectX = serializedObjectX;
     this.type     = type;
     this.value    = value ?? CreateValue(type);
     originalValue = value;
     changed       = false;
     name          = fieldName;
     displayName   = Util.SplitAndTitlize(fieldName);
     isExpanded    = true; //todo find a way to get a unique id for these so we can save isExpanded between loads
     label         = new GUIContent(displayName);
     BuildProperties(true);
 }
コード例 #2
0
    public override void OnInspectorGUI()
    {
        PlayerSkillBook skillBook = target as PlayerSkillBook;

        if (root == null)
        {
            if (!string.IsNullOrEmpty(skillBook.source))
            {
                new AssetDeserializer(skillBook.source, false).DeserializeInto("__default__", skillBook);
            }
            root = new SerializedObjectX(target);
        }
        EditorGUILayoutX.DrawProperties(root);
        bool didChange = root.Root.ApplyModifiedProperties();

        if (didChange)
        {
            AssetSerializer serializer = new AssetSerializer();
            serializer.AddItem(target);
            serializedObject.FindProperty("source").stringValue = serializer.WriteToString();
            serializedObject.ApplyModifiedProperties();
        }
    }
コード例 #3
0
 public static void DrawProperties(SerializedObjectX obj)
 {
     DrawProperties(obj.Root);
 }
コード例 #4
0
 public static void DrawProperties(SerializedObjectX obj) {
     DrawProperties(obj.Root);
 }
コード例 #5
0
ファイル: AssetItem.cs プロジェクト: Ollydbg/AbilitySystem
 public virtual void Load()
 {
     serialRootObjectX = new SerializedObjectX(GetAssetCreator().Create());
 }
コード例 #6
0
 public static void Draw(Rect position, SerializedObjectX obj)
 {
 }
コード例 #7
0
ファイル: EditorGUIX.cs プロジェクト: weichx/AbilitySystem
 public static void Draw(Rect position, SerializedObjectX obj) {
     
 }