Skip to content

Instantly share code, notes, and snippets.

@paulhayes
Last active August 29, 2015 14:02
Show Gist options
  • Save paulhayes/c127c1d0b89f8c2ee09c to your computer and use it in GitHub Desktop.
Save paulhayes/c127c1d0b89f8c2ee09c to your computer and use it in GitHub Desktop.
Unity MonoBehaviour Attribute Examples
using UnityEngine;
[SelectionBase]
public class Character : MonoBehaviour
{
[Header("Info")]
public string name;
[Space(10)]
[TextArea(3,8)] // or the more basic alternative [Multiline(3)]
[Tooltip("140 characters or less")]
public string description;
[Header("Stats")]
[Range(0,100)]
public float intelligence;
[Range(0,100)]
public float bravery;
[Header("Equipment")]
[Tooltip("Character starts with the following items")]
public string[] items;
public float weightLimit;
void Start ()
{
}
void Update ()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment