void ProduceSun() { if (moneycount <= 0) { //int x = Random.Range(0, StageMap.ROW_MAX); //int y = Random.Range(0, StageMap.COL_MAX); //int y = Random.Range(4, 7); int[] x_array = new int[5] { 0, 2, 3, 1, 4 }; int[] y_array = new int[5] { 2, 8, 3, 0, 5 }; if (i < 5) { int x = x_array[i]; int y = y_array[i]; if (model.sunMap[x, y] == null) { GameObject sun = Instantiate(sunPrefab); sun.transform.position = StageMap.GetSunPos(x, y); ScaleUp scaleup = sun.AddComponent <ScaleUp>(); scaleup.Begin(); model.sunMap[x, y] = sun; } i++; } //int x = Random.Range(0, StageMap.ROW_MAX); //int y = Random.Range(0, StageMap.COL_MAX); //if (model.sunMap[x, y] == null) //{ // GameObject sun = Instantiate(sunPrefab); // sun.transform.position = StageMap.GetSunPos(x, y); // ScaleUp scaleup = sun.AddComponent<ScaleUp>(); // scaleup.Begin(); // model.sunMap[x, y] = sun; //} } }