¸ÕÀú ¼Ò½º ÀÔ´Ï´Ù.
using UnityEngine;
using System.Collections;
public class Enemy : MonoBehaviour {
public float _speed = 0.3f;
public int a =0;
public enum movement
{ up, down, left, right } // 0,1,2,3
public int move; // »óÇÏÁ¿ì Áß ÇϳªÀÇ °ªÀ» °¡Áú moveº¯¼ö
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
{
if(a==0){
move = 0;}
if(a==1){
move = 1;}
if(a==2){
move = 2;}
if(a==3){
move = 3;}
_moveOnmap();
switch(a){
case 0:
transform.Translate(_speed*Time.deltaTime*Vector3.left);
break;
case 1:
transform.Translate(_speed * Time.deltaTime * Vector3.right);
break;
case 2:
transform.Translate(_speed*Time.deltaTime*Vector3.forward);
break;
case 3 :
transform.Translate(_speed*Time.deltaTime*Vector3.back);
break;
}
}
}
void _moveOnmap()
{
//float _deltaPosY = Random.Range(0,Screen.height);
// float _deltaPosX = Random.Range(0,Screen.width);
}
}
ÀÌ·¸°Ô Çϸé 0~3¹ø¿¡¼ ¼ýÀÚ¸¦ ³ÖÀ¸¸é ¿øÇÏ´Â ¹æÇâÀ¸·Î ¿òÁ÷À̴µ¥¿ä..
¿©±â¼ ¿øÇÏ´Â À§Ä¡¿¡ °¬´Ù°¡ ´Ù½Ã µ¹¾Æ¿À´Â°É ¹Ýº¹ ÇÏ°í ½ÍÀºµ¥...
¾î¶»°Ô ÇÏ¸é µÉ±î¿ä??
óÀ½¿¡´Â ·£´ý ÇÔ¼ö¸¦ ½áº¼±î ÇÏ´Ù°¡ À߾ȵǼ ÀÌ·¸°Ô Çß½À´Ï´Ù. | |
|
±×ÈÄ Å¸À̸Ӹ¦ ÀÌ¿ëÇÏ¿© °´Ã¼ÀÇ ÁÂÇ¥¸¦ üũÇÑ ÈÄ ÁÂÇ¥°¡ º¯Çß´Ù¸é ¹Ý´ëÁÂÇ¥³ª óÀ½ ½ÃÀÛ ÁÂÇ¥·Î µ¹¾Æ¿À´Â Äڵ带 Â¥½Ã¸é µÉ°Ì´Ï´Ù.