Skip to content

Instantly share code, notes, and snippets.

@inertiave
Created November 15, 2019 19:55
Show Gist options
  • Save inertiave/eb34d73b9004fd1c53b123ec927583fd to your computer and use it in GitHub Desktop.
Save inertiave/eb34d73b9004fd1c53b123ec927583fd to your computer and use it in GitHub Desktop.
public enum EReadOnlyType {
FULLY_DISABLED,
EDITABLE_RUNTIME,
EDITABLE_EDITOR,
}
public class ReadOnlyAttribute : UnityEngine.PropertyAttribute {
public readonly EReadOnlyType runtimeOnly;
public ReadOnlyAttribute(EReadOnlyType runtimeOnly = EReadOnlyType.FULLY_DISABLED)
{
this.runtimeOnly = runtimeOnly;
}
}
public class BeginReadOnlyAttribute : UnityEngine.PropertyAttribute { }
public class EndReadOnlyAttribute : UnityEngine.PropertyAttribute { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment