Created
January 23, 2014 20:03
-
-
Save jacobdufault/8585787 to your computer and use it in GitHub Desktop.
Code for the Full Inspector screenshots
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
using Forge.Editing; | |
using Newtonsoft.Json; | |
using System.Collections.Generic; | |
using UnityEngine; | |
namespace Forge.Demo { | |
public enum MyEnum { | |
Option1, Option2, Option3, Option4, Option5 | |
} | |
[JsonObject(MemberSerialization.OptIn)] | |
public class DictionaryDemoBehavior : BaseBehavior { | |
[JsonProperty] | |
public Dictionary<MyEnum, GameObject> EnumGameObjectDict; | |
[JsonProperty] | |
public Dictionary<string, string> StrStrDict; | |
} | |
} |
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
using Forge.Editing; | |
using Newtonsoft.Json; | |
namespace Forge.Demo { | |
[JsonObject(MemberSerialization.OptIn)] | |
public class MyGenericType<T> { | |
[JsonProperty] | |
public T Value; | |
} | |
[JsonObject(MemberSerialization.OptIn)] | |
public class GenericTypeDemoBehavior : BaseBehavior { | |
[JsonProperty] | |
public MyGenericType<bool> GenericBool; | |
[JsonProperty] | |
public MyGenericType<float> GenericFloat; | |
} | |
} |
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
using Forge.Editing; | |
using Newtonsoft.Json; | |
namespace Forge.Demo { | |
[JsonObject(MemberSerialization.OptIn)] | |
public interface IInterface { | |
} | |
[JsonObject(MemberSerialization.OptIn)] | |
public class Implementation1 : IInterface { | |
[JsonProperty] | |
public int A; | |
} | |
[JsonObject(MemberSerialization.OptIn)] | |
public class Implementation2 : IInterface { | |
[JsonProperty] | |
public bool B; | |
} | |
[JsonObject(MemberSerialization.OptIn)] | |
public class InterfaceDemoBehavior : BaseBehavior { | |
[JsonProperty] | |
public IInterface MyInterface; | |
} | |
} |
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
using Forge.Editing; | |
using Newtonsoft.Json; | |
using System.Collections.Generic; | |
namespace Forge.Demo { | |
[JsonObject(MemberSerialization.OptIn)] | |
public class ListDemoBehavior : BaseBehavior { | |
[JsonProperty] | |
public List<int> Ints; | |
[JsonProperty] | |
public float[] Floats; | |
} | |
} |
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
using Forge.Editing; | |
using Newtonsoft.Json; | |
namespace Forge.Demo { | |
[JsonObject(MemberSerialization.OptIn)] | |
public class PropertiesDemoBehavior : BaseBehavior { | |
[JsonProperty] | |
public int MyProperty { get; private set; } | |
} | |
} |
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
using Forge.Editing; | |
using Newtonsoft.Json; | |
namespace Forge.Demo { | |
[JsonObject(MemberSerialization.OptIn)] | |
public struct Struct { | |
[JsonProperty] | |
public int A; | |
[JsonProperty] | |
public bool B; | |
} | |
[JsonObject(MemberSerialization.OptIn)] | |
public class StructDemoBehavior : BaseBehavior { | |
[JsonProperty] | |
public Struct Value; | |
} | |
} |
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
using Forge.Editing; | |
using Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
namespace Forge.Demo { | |
[JsonObject(MemberSerialization.OptIn)] | |
public class TooltipsAndCommentsDemoBehavior : BaseBehavior { | |
[Comment("This is a comment")] | |
[JsonProperty] | |
public int Comment; | |
[Tooltip("This has a tooltip")] | |
[JsonProperty] | |
public int Tooltip; | |
[Margin(50)] | |
[JsonProperty] | |
public int FarDown; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment