using UnityEngine;

using System.Collections;


public class LightMan : MonoBehaviour {

Light myLight;

Transform t;

// Use this for initialization

void Start () {

myLight = GetComponent<Light>(); //남의 꺼를 가져올때 쓰입니다.졸려

t = GetComponent<Transform>();

t = GetComponent("Transform") as Transform;

}

// Update is called once per frame

void Update () {

if (Input.GetKeyDown(KeyCode.L)){

myLight.enabled = !myLight.enabled;

}

}

}





'Computer Language > 유니티' 카테고리의 다른 글

LookAt()  (0) 2014.05.23
vector3 사용예제  (0) 2014.05.23
껏다 켯다 하기  (0) 2014.05.23
생명 주기와 색깔 바꾸기  (0) 2014.05.23
로그 찍기  (0) 2014.05.23

+ Recent posts