|
|
@ -177,7 +177,8 @@ public class MapManager : Singleton<MapManager> |
|
|
|
|
|
|
|
|
IEnumerator GenerateProcess() |
|
|
IEnumerator GenerateProcess() |
|
|
{ |
|
|
{ |
|
|
yield return StartCoroutine(MapGenerateDefault()); |
|
|
// yield return StartCoroutine(MapGenerateDefault());
|
|
|
|
|
|
yield return StartCoroutine(MapGenerateCube()); |
|
|
yield return StartCoroutine(SetUpMapUnity()); |
|
|
yield return StartCoroutine(SetUpMapUnity()); |
|
|
yield return StartCoroutine(TransformMapUnity()); |
|
|
yield return StartCoroutine(TransformMapUnity()); |
|
|
yield return StartCoroutine(SetUpMapUnityForCube()); |
|
|
yield return StartCoroutine(SetUpMapUnityForCube()); |
|
|
@ -511,7 +512,7 @@ public class MapManager : Singleton<MapManager> |
|
|
} |
|
|
} |
|
|
yield return null; |
|
|
yield return null; |
|
|
} |
|
|
} |
|
|
|
|
|
//两边尖尖的地块
|
|
|
IEnumerator MapGenerateDefault() |
|
|
IEnumerator MapGenerateDefault() |
|
|
{ |
|
|
{ |
|
|
int middleLine = (line - 1) / 2; |
|
|
int middleLine = (line - 1) / 2; |
|
|
@ -554,7 +555,35 @@ public class MapManager : Singleton<MapManager> |
|
|
yield return null; |
|
|
yield return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//正方形地块
|
|
|
|
|
|
IEnumerator MapGenerateCube() |
|
|
|
|
|
{ |
|
|
|
|
|
for (int i = 0; i < line; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
if (i != 0) |
|
|
|
|
|
{ |
|
|
|
|
|
generatePoint.transform.position += columnOffSet; |
|
|
|
|
|
} |
|
|
|
|
|
generatePoint.transform.position = new Vector3(0, 0, generatePoint.transform.position.z); |
|
|
|
|
|
|
|
|
|
|
|
if (i % 2 != 0) |
|
|
|
|
|
{ |
|
|
|
|
|
generatePoint.transform.position += (lineOffSet / 2.0f); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < column; j++) |
|
|
|
|
|
{ |
|
|
|
|
|
var a = Instantiate(mapUnity, generatePoint.transform.position, mapUnity.transform.rotation); |
|
|
|
|
|
a.transform.SetParent(mapUnityFather); |
|
|
|
|
|
MapUnity currentMapUnityScript = a.GetComponent<MapUnity>(); |
|
|
|
|
|
currentMapUnityScript.locationX = i; |
|
|
|
|
|
currentMapUnityScript.locationY = j; |
|
|
|
|
|
currentMapUnityScript.RegisterUnit(); |
|
|
|
|
|
generatePoint.transform.position += lineOffSet; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
yield return null; |
|
|
|
|
|
} |
|
|
//地块上移动画
|
|
|
//地块上移动画
|
|
|
IEnumerator UPMoveMapUnity() |
|
|
IEnumerator UPMoveMapUnity() |
|
|
{ |
|
|
{ |
|
|
|