//prefab의 자식객체에 접근 되는지 test //문법 확인용으로 만든 함수. 나중에 삭제 //private void TestPrint() //{ // Debug.Log("가진 자식의 수"+controllingObject.transform.childCount); // for (int i = 0; i < controllingObject.transform.childCount; i++) // { // Debug.Log("자식들의 위치 "+(i+1)+" : "+controllingObject.transform.GetChild(i).transform.position ); // Debug.Log("자식들의 이름 " + (i + 1) + " : "+ controllingObject.transform.GetChild(i).gameObject.name); // } // if (controllingObject.transform.GetChild(1) != null) // Destroy(controllingObject.transform.GetChild(1).gameObject); // int a = 30, b = 40; // List<int> origin = new List<int>(); // origin.Add(a); // origin.Add(b); // print(origin[0] + "<- origin a value, " + origin[1] + "<- b value"); // List<int> copy = new List<int>(origin); // print(copy[0] + "<- Copy a value, " + copy[1] + "<- b value"); // copy[0] = 60; // print(origin[0] + "<- origin a value, " + origin[1] + "<- b value"); // print(copy[0] + "<- Copy a value, " + copy[1] + "<- b value"); // print(a + "a<- value"); // a = 100; // print(origin[0] + "<- origin a value, " + origin[1] + "<- b value"); // print(copy[0] + "<- Copy a value, " + copy[1] + "<- b value"); // print(a + "<- a value"); // origin = copy; // print(origin[0] + "<- origin a value, " + origin[1] + "<- b value"); // print(copy[0] + "<- Copy a value, " + copy[1] + "<- b value"); // print(a + "<- a value"); // List<int> other = new List<int>(); // other.Add(900); // other.Add(1000); // copy[0] = 700; // copy = other; // print(origin[0] + "<- origin a value, " + origin[1] + "<- b value"); // print(copy[0] + "<- Copy a value, " + copy[1] + "<- b value"); // print(other[0] + "<- other a value, " + other[1] + "<- b value"); // print(a + "<- a value"); // other.Clear(); // print(origin[0] + "<- origin a value, " + origin[1] + "<- b value"); // print(copy[0] + "<- Copy a value, " + copy[1] + "<- b value"); // print(other[0] + "<- other a value, " + other[1] + "<- b value"); // print(a + "<- a value"); //} //입력을 처리한다 //좌우 이동, 회전 private void InputProcess() { if (!controllingObject) { return; } if (!power) { return; //if power off, stop input process } if (Input.anyKeyDown) { if (Input.GetKeyDown(KeyCode.LeftArrow) && isAllowedTo[command.LEFT] == true) { movementComonent.MoveLeft(); return; } if (Input.GetKeyDown(KeyCode.RightArrow) && isAllowedTo[command.RIGHT] == true) { movementComonent.MoveRight(); return; } if (Input.GetKeyDown(KeyCode.UpArrow)) { movementComonent.Rotate(); return; } } if (Input.GetKey(KeyCode.DownArrow)) { downFaster(); return; } }