// Update is called once per frame void Update() { if (isSceneStart) { return; } if (isInit == false) { sceneMaze = this.gameObject.transform.GetComponent <Generator3D>(); roleMain = this.gameObject.transform.GetComponent <Main>(); } if (sceneIsFinish == false) { if ((sceneMaze.getIsInit()) && (roleMain.getIsInit())) { roleMain.createRole(sceneMaze.firstPos); sceneAlphaControl sceneAlpha = Camera.main.GetComponent <sceneAlphaControl>(); sceneAlpha._target = roleMain.character.roleInstance; sceneIsFinish = true; } } }
void Start() { if (loopCount < 1000) { Generator3D levelGenerator = FindObjectOfType <Generator3D>(); loopCount++; levelGenerator.GenerateLevel(); //SceneManager.LoadScene(SceneManager.GetActiveScene().name); } }
private void initRole() { Generator3D tmpMaze = this.gameObject.transform.GetComponent <Generator3D>(); if (tmpMaze != null) { createRole(tmpMaze.firstPos); } else { createRole(new Vector3(5, 0.005f, -5)); } }
private void test3D(int x, int y, int z, int number) { Generator3D gen = new Generator3D(DateTime.Now.Millisecond); List <Island3D> islands = gen.generateIslands(x, y, z, number); List <GameObject> g_islands = new List <GameObject> (); GameObject test, objectModel; for (int i = 0; i < islands.Count; i++) { test = Instantiate(island, new Vector3(islands [i].getX(), islands [i].getY(), islands [i].getZ()), Quaternion.identity) as GameObject; test.GetComponent <G_Island> ().Value = islands [i].getValue(); objectModel = Instantiate(numberModels [islands [i].getValue()], new Vector3(islands [i].getX(), islands [i].getY(), islands [i].getZ()), Quaternion.Euler(new Vector3(-90, 0, 0))) as GameObject; objectModel.transform.SetParent(test.transform); g_islands.Add(test); } }