Last active
August 29, 2015 13:56
-
-
Save Buravo46/8845412 to your computer and use it in GitHub Desktop.
【Unity】GUI.Buttonを使ったLifeの表示。
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 UnityEngine; | |
using System.Collections; | |
public class LifeScript : MonoBehaviour { | |
public int life = 3; | |
public GUISkin skin; | |
public GUIContent contents; | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
void OnGUI(){ | |
GUI.skin=skin; | |
for(int i = 1; i <= life; i++){ | |
// new Rect(x, y, width, height) | |
GUI.Button(new Rect (30*i,10,20,20), contents); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment