Split ZoneRenderer asset palette from GameSettings
This commit is contained in:
parent
0768b868fd
commit
21b3abca9f
3 changed files with 15 additions and 5 deletions
|
|
@ -2051,6 +2051,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
Settings.GameplaySettings,
|
||||
Debug.Log);
|
||||
LoadRuntimeLoadoutTemplates(stateBoot.StateFilePath);
|
||||
ZoneRenderer.BodySettingsCollections = Settings.BodySettingsCollections;
|
||||
ZoneRenderer.RenderSettings = ObservedDaemonRenderSettings();
|
||||
_zoomLevelIndex = ZoneRenderer.RenderSettings.ResolveDefaultMinimapZoomIndex();
|
||||
ZoneRenderer.MinimapDistance = (float)ZoneRenderer.RenderSettings.ResolveMinimapDistance(_zoomLevelIndex);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
public Transform WormholePrefab;
|
||||
public float EntityFadeTime;
|
||||
public Transform FogCameraParent;
|
||||
public GameSettings Settings;
|
||||
public BodySettingsCollection[] BodySettingsCollections;
|
||||
public Transform ZoneRoot;
|
||||
public Transform SectorBrushes;
|
||||
public MeshRenderer SectorBoundaryBrush;
|
||||
|
|
@ -459,10 +459,11 @@ public class ZoneRenderer : MonoBehaviour
|
|||
else
|
||||
{
|
||||
planet = Instantiate(Planet, ZoneRoot);
|
||||
var possibleSettings = Settings.BodySettingsCollections
|
||||
var possibleSettings = (BodySettingsCollections ?? Array.Empty<BodySettingsCollection>())
|
||||
.Where(p => p.MinimumMass < mass)
|
||||
.MaxBy(p => p.MinimumMass).BodySettings;
|
||||
planet.Generator.body = possibleSettings[Random.Range(0, possibleSettings.Length)];
|
||||
.MaxBy(p => p.MinimumMass)?.BodySettings ?? Array.Empty<CelestialBodySettings>();
|
||||
if (possibleSettings.Length > 0)
|
||||
planet.Generator.body = possibleSettings[Random.Range(0, possibleSettings.Length)];
|
||||
//Debug.Log($"Generating planet with {mass} mass! Choosing {planet.Generator.body.name} settings!");
|
||||
//planet.Icon.material.mainTexture = planetInstance.Mass > Context.GlobalData.PlanetMass ? PlanetIcon : PlanetoidIcon;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue