예제 #1
0
        private void Start()
        {
            Vector3 startingPosition = new Vector3((float)(-XNumber + 1) / 2 * Gap, 0, (float)(-ZNumber + 1) / 2 * Gap);
            Vector3 newPosition      = startingPosition;

            for (int i = 0; i < XNumber; i++)
            {
                for (int j = 0; j < ZNumber; j++)
                {
                    CubeEntity cubeEntity = Instantiate(CubePrefab, newPosition, Quaternion.identity).GetComponent <CubeEntity>();
                    cubeEntity.name = "Cube " + (i + j);
                    GameManager.CubeEntities.Add(cubeEntity);
                    newPosition.z += Gap;
                }
                newPosition.z  = startingPosition.z;
                newPosition.x += Gap;
            }
        }
예제 #2
0
파일: CubeAI.cs 프로젝트: r2d2m/ReflexityAI
 private void Awake()
 {
     CubeEntity = GetComponent <CubeEntity>();
 }