using UnityEngine;

using System.Collections;


public class ExMove : MonoBehaviour {

Vector3[] pos = new Vector3[4]{new Vector3(15, 0, 15), new Vector3(-15, 0, 15), new Vector3(-15, 0, -15), new Vector3(15, 0, -15)};

int index = 0;

int count = 0;

int mode = 0;

// Use this for initialization

void Start () {

}

// Update is called once per frame

void Update () {

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

transform.position = pos[index];

index++;

print (index);

if(index >= pos.Length)  //인덱스 초기화

index = 0;

}

if(Input.GetKey(KeyCode.UpArrow))

transform.localScale = transform.localScale + Vector3.one * 0.01f;

if(Input.GetKey(KeyCode.DownArrow))

transform.localScale = transform.localScale - Vector3.one * 0.01f;

}

}


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

Target.position.x 에 대한 고찰  (0) 2014.04.29
차이를 이용하여 이동시켜 보잨ㅋㅋ  (0) 2014.04.29
벡터 크기증가와 이동  (0) 2014.04.29
좌우로 움직이는 로봇  (0) 2014.04.29
추축축  (0) 2014.04.28

+ Recent posts