void Start() // 괴물과 아이템의 종류를 선업합니. { var Key_ran = GameObject.Find("key_o").GetComponent <Keyrandom>(); for (int i = 0; i < Key_ran.key.Length; i++) { if (Key_ran.cnt[i] == 1) { itemObj[1] = Key_ran.key[i]; } } var Po_ran = GameObject.Find("po_o").GetComponent <Keyrandom>(); for (int i = 0; i < Po_ran.key.Length; i++) { if (Po_ran.cnt[i] == 1) { itemObj[0] = Po_ran.key[i]; } } thePlayerMoving = thePlayer.GetComponent <CharcterMoving>(); theEnemy = new EnemyManager[enemyObj.Length]; for (int i = 0; i < enemyObj.Length; i++) { theEnemy[i] = enemyObj[i].GetComponent <EnemyManager>(); } theItem = new ItemManager[itemObj.Length]; for (int i = 0; i < itemObj.Length; i++) { theItem[i] = itemObj[i].GetComponent <ItemManager>(); } }
void Start() { thePlayerMoving = thePlayer.GetComponent <CharcterMoving>(); // 플레이어의 상태를 받아옵니다 theEnemy = new EnemyManager[enemyObj.Length]; // 에나미 매니저 스크립트를 받아옵니다 theItem = new ItemManager[itemObj.Length]; // 아이템 매니저 스크립트를 받아옵니다 var Key_ran = GameObject.Find("key_o").GetComponent <Keyrandom>(); for (int i = 0; i < Key_ran.key.Length; i++) { if (Key_ran.cnt[i] == 1) { enemyObj[1] = Key_ran.key[i]; itemObj[1] = Key_ran.key[i]; } } var Po_ran = GameObject.Find("po_o").GetComponent <Keyrandom>(); for (int i = 0; i < Po_ran.key.Length; i++) { if (Po_ran.cnt[i] == 1) { enemyObj[0] = Po_ran.key[i]; itemObj[0] = Po_ran.key[i]; } } for (int i = 0; i < enemyObj.Length; i++) { theEnemy[i] = enemyObj[i].GetComponent <EnemyManager>(); } for (int i = 0; i < itemObj.Length; i++) { theItem[i] = itemObj[i].GetComponent <ItemManager>(); } }
// Start is called before the first frame update void Start() { charcter = thePlayer.GetComponent <CharcterMoving>(); //플레이어의 상태를 파악합니다. }
// Start is called before the first frame update void Start() { thePlayerMoving = thePlayer.GetComponent <CharcterMoving>(); }
// Start is called before the first frame update void Start() { thePlayerMoving = thePlayer.GetComponent <CharcterMoving>(); //플레이어의 상태를 받아옵니. }