本文整理汇总了C#中GameControl.GetGameMapSeed方法的典型用法代码示例。如果您正苦于以下问题:C# GameControl.GetGameMapSeed方法的具体用法?C# GameControl.GetGameMapSeed怎么用?C# GameControl.GetGameMapSeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameControl
的用法示例。
在下文中一共展示了GameControl.GetGameMapSeed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
LoadLocationNames();
background = GameObject.Find ("MapScreenBackground");
if (!background) Debug.Log("Can't find map background");
InputRepeater repeater = background.AddComponent<InputRepeater>();
repeater.SetTarget(transform);
GameObject cameraControlObj = GameObject.Find ("CameraPivot");
cameraControl = cameraControlObj.GetComponent<MapCameraControl>();
cameraControl.SetUp(this);
if (!cameraControl) Debug.Log("Can't find map camera");
GameObject gameControlObj = GameObject.Find ("GameControl");
gameControl = gameControlObj.GetComponent<GameControl>();
if (!gameControl) Debug.Log("Can't find GameControl");
Random.seed = gameControl.GetGameMapSeed();
GameObject point = null;
if (interval < 1) {
Debug.Log("Inverval too low");
return;
}
int zOffset = 0;
for (int x = 0; x < width; x += interval) {
if (zOffset == 0) {
zOffset = 1;
} else {
zOffset = 0;
}
for (int z = zOffset; z < length; z += interval) {
if (Random.value < density) {
point = Instantiate(dotPrefab, Vector3.zero, Quaternion.identity) as GameObject;
point.transform.name = "Point-" + x + "-" + z;
Vector3 randomOffset = new Vector3(Random.Range(-0.25f, 0.25f), 0, Random.Range(-0.25f, 0.25f));
Vector3 centerOffset = new Vector3(-(float) width * 0.5f, 0, -(float)length * 0.5f);
point.transform.parent = transform;
point.transform.localPosition = new Vector3(x, 0, z) + randomOffset + centerOffset;
point.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
points.Add(point.transform);
}
}
}
point.renderer.sharedMaterial.renderQueue = 3100;
CreatePlayerBase();
CreateEnemyBase();
ConnectBases();
SetUpConnections();
SetSpecialNodes();
string nextStep = gameControl.currentLevel.Equals("Menu") ? "MapIntro" : "AddResults";
Invoke (nextStep, 2);
portraitThief = GameObject.Find ("MapScreenThief").transform;
portraitThief.animation.Play("Intro");
Invoke ("playPortraitLoop", portraitThief.animation["Intro"].length);
}