Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Forked from anonymous/AddCount.cs
Last active December 24, 2015 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/6751632 to your computer and use it in GitHub Desktop.
Save tsubaki/6751632 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class AddCount : MonoBehaviour
{
[SerializeField]
Sample data;
void OnGUI ()
{
GUILayout.Label (data.count.ToString ());
if (GUILayout.Button ("add")) {
data.count += 1;
}
}
}
public class Sample : ScriptableObject
{
public string data;
public int count;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment