using UnityEngine;
using System.Collections;
public class newsource : MonoBehaviour {
public int hp;
void Awake(){
print ("Awake name = " + name);
}
void OnEnable(){
print ("OnEnabel name = " + name);
}
void OnDisable(){
print ("OnDisable name = " + name);
}
// Use this for initialization
void Start () {
print ("Start name = " + name);
}
void Reset(){
print ("Reset name = " + name);
hp = 20;
}
void FixedUpdate(){
print ("FixedUpdate = " + Time.deltaTime);
}
// Update is called once per frame
void Update () {
if(Input.GetKeyDown(KeyCode.R)){
gameObject.renderer.material.color = Color.red;
}
if(Input.GetKeyDown(KeyCode.G)){
gameObject.renderer.material.color = Color.green;
}
if(Input.GetKeyDown(KeyCode.B)){
gameObject.renderer.material.color = Color.blue;
}
}
}
'Computer Language > 유니티' 카테고리의 다른 글
불 껏다 키기 (0) | 2014.05.23 |
---|---|
껏다 켯다 하기 (0) | 2014.05.23 |
로그 찍기 (0) | 2014.05.23 |
오브젝트 찾고 지우기 1. 태그 2. 이름 (0) | 2014.05.23 |
이것만은 알고갚시다. 9장. (0) | 2014.05.20 |