mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fixed spawn points
And number of title screen bodies
This commit is contained in:
parent
a158f05a9d
commit
f2fdfa033a
@ -20,10 +20,10 @@ namespace NewHorizons.Builder.General
|
|||||||
|
|
||||||
spawnGO.transform.localPosition = module.PlayerSpawnPoint;
|
spawnGO.transform.localPosition = module.PlayerSpawnPoint;
|
||||||
|
|
||||||
// Move it up a bit more
|
|
||||||
spawnGO.transform.position = spawnGO.transform.position + spawnGO.transform.TransformDirection(Vector3.up) * 1f;
|
|
||||||
|
|
||||||
playerSpawn = spawnGO.AddComponent<SpawnPoint>();
|
playerSpawn = spawnGO.AddComponent<SpawnPoint>();
|
||||||
|
spawnGO.transform.rotation = Quaternion.FromToRotation(Vector3.up, (playerSpawn.transform.position - body.transform.position).normalized);
|
||||||
|
spawnGO.transform.position = spawnGO.transform.position + spawnGO.transform.TransformDirection(Vector3.up) * 2f;
|
||||||
|
|
||||||
GameObject.FindObjectOfType<PlayerSpawner>().SetInitialSpawnPoint(playerSpawn);
|
GameObject.FindObjectOfType<PlayerSpawner>().SetInitialSpawnPoint(playerSpawn);
|
||||||
}
|
}
|
||||||
if(module.ShipSpawnPoint != null)
|
if(module.ShipSpawnPoint != null)
|
||||||
|
|||||||
@ -209,29 +209,28 @@ namespace NewHorizons
|
|||||||
var eligibleCount = eligible.Count();
|
var eligibleCount = eligible.Count();
|
||||||
if (eligibleCount == 0) return;
|
if (eligibleCount == 0) return;
|
||||||
|
|
||||||
var selectionCount = Mathf.Max(eligibleCount, UnityEngine.Random.Range(1, 3));
|
var selectionCount = Mathf.Min(eligibleCount, 3);
|
||||||
var indices = RandomUtility.GetUniqueRandomArray(0, eligible.Count(), selectionCount);
|
var indices = RandomUtility.GetUniqueRandomArray(0, eligible.Count(), selectionCount);
|
||||||
|
|
||||||
var body = eligible[UnityEngine.Random.Range(0, eligibleCount)];
|
Logger.Log($"Displaying {selectionCount} bodies on the title screen");
|
||||||
|
|
||||||
Logger.Log($"Displaying {body.Config.Name} on the title screen");
|
|
||||||
|
|
||||||
GameObject body1, body2, body3;
|
GameObject body1, body2, body3;
|
||||||
|
|
||||||
body1 = LoadTitleScreenBody(eligible[indices[0]]);
|
body1 = LoadTitleScreenBody(eligible[indices[0]]);
|
||||||
if (selectionCount > 2)
|
Logger.LogPath(body1);
|
||||||
|
if (selectionCount > 1)
|
||||||
{
|
{
|
||||||
body1.transform.localScale = Vector3.one * (body1.transform.localScale.x) * 0.3f;
|
body1.transform.localScale = Vector3.one * (body1.transform.localScale.x) * 0.3f;
|
||||||
body1.transform.localPosition = new Vector3(0, -10, 0);
|
body1.transform.localPosition = new Vector3(0, -20, 0);
|
||||||
body2 = LoadTitleScreenBody(eligible[indices[1]]);
|
body2 = LoadTitleScreenBody(eligible[indices[1]]);
|
||||||
body2.transform.localScale = Vector3.one * (body2.transform.localScale.x) * 0.3f;
|
body2.transform.localScale = Vector3.one * (body2.transform.localScale.x) * 0.3f;
|
||||||
body2.transform.localPosition = new Vector3(7, 40, 0);
|
body2.transform.localPosition = new Vector3(7, 40, 0);
|
||||||
}
|
}
|
||||||
if (selectionCount > 3)
|
if (selectionCount > 2)
|
||||||
{
|
{
|
||||||
body3 = LoadTitleScreenBody(eligible[indices[2]]);
|
body3 = LoadTitleScreenBody(eligible[indices[2]]);
|
||||||
body3.transform.localScale = Vector3.one * (body3.transform.localScale.x) * 0.3f;
|
body3.transform.localScale = Vector3.one * (body3.transform.localScale.x) * 0.3f;
|
||||||
body3.transform.localPosition = new Vector3(-5, 15, 0);
|
body3.transform.localPosition = new Vector3(-5, 10, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject.Find("Scene/Background/PlanetPivot/Prefab_HEA_Campfire").SetActive(false);
|
GameObject.Find("Scene/Background/PlanetPivot/Prefab_HEA_Campfire").SetActive(false);
|
||||||
@ -251,8 +250,8 @@ namespace NewHorizons
|
|||||||
Logger.Log($"Displaying {body.Config.Name} on the title screen");
|
Logger.Log($"Displaying {body.Config.Name} on the title screen");
|
||||||
GameObject titleScreenGO = new GameObject(body.Config.Name + "_TitleScreen");
|
GameObject titleScreenGO = new GameObject(body.Config.Name + "_TitleScreen");
|
||||||
HeightMapModule heightMap = new HeightMapModule();
|
HeightMapModule heightMap = new HeightMapModule();
|
||||||
var minSize = 20;
|
var minSize = 15;
|
||||||
var maxSize = 35;
|
var maxSize = 30;
|
||||||
float size = minSize;
|
float size = minSize;
|
||||||
if (body.Config.HeightMap != null)
|
if (body.Config.HeightMap != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user