Exemplo n.º 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);
 }
Exemplo n.º 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();
        }
    }
Exemplo n.º 3
0
 public static void DrawProperties(SerializedObjectX obj)
 {
     DrawProperties(obj.Root);
 }
Exemplo n.º 4
0
 public static void DrawProperties(SerializedObjectX obj) {
     DrawProperties(obj.Root);
 }
Exemplo n.º 5
0
 public virtual void Load()
 {
     serialRootObjectX = new SerializedObjectX(GetAssetCreator().Create());
 }
Exemplo n.º 6
0
 public static void Draw(Rect position, SerializedObjectX obj)
 {
 }
Exemplo n.º 7
0
 public static void Draw(Rect position, SerializedObjectX obj) {
     
 }