im insano mode

This commit is contained in:
Nick 2023-04-22 16:11:55 -04:00
parent 4bac76b0bb
commit 942a37df2a
39 changed files with 143 additions and 144 deletions

View File

@ -31,7 +31,7 @@ namespace NewHorizons.Builder.Atmosphere
_isInit = true;
if (_atmospherePrefab == null) _atmospherePrefab = SearchUtilities.Find("TimberHearth_Body/Atmosphere_TH/AtmoSphere").InstantiateInactive().Rename("Atmosphere").DontDestroyOnLoad();
if (_proxyAtmospherePrefab == null) _proxyAtmospherePrefab = GameObject.FindObjectOfType<DistantProxyManager>()._proxies.FirstOrDefault(apt => apt.astroName == AstroObject.Name.TimberHearth).proxyPrefab.FindChild("Atmosphere_TH/Atmosphere_LOD3").InstantiateInactive().Rename("ProxyAtmosphere").DontDestroyOnLoad();
if (_proxyAtmospherePrefab == null) _proxyAtmospherePrefab = Object.FindObjectOfType<DistantProxyManager>()._proxies.FirstOrDefault(apt => apt.astroName == AstroObject.Name.TimberHearth).proxyPrefab.FindChild("Atmosphere_TH/Atmosphere_LOD3").InstantiateInactive().Rename("ProxyAtmosphere").DontDestroyOnLoad();
}
public static GameObject Make(GameObject planetGO, Sector sector, AtmosphereModule atmosphereModule, float surfaceSize, bool proxy = false)
@ -48,7 +48,7 @@ namespace NewHorizons.Builder.Atmosphere
if (prefab != null)
{
GameObject atmo = GameObject.Instantiate(prefab, atmoGO.transform);
GameObject atmo = Object.Instantiate(prefab, atmoGO.transform);
atmo.name = "Atmosphere";
atmo.transform.localPosition = Vector3.zero;
atmo.transform.localEulerAngles = Vector3.zero;

View File

@ -50,7 +50,7 @@ namespace NewHorizons.Builder.Atmosphere
if (config.Atmosphere.hasRain)
{
var rainGO = GameObject.Instantiate(_rainEmitterPrefab, effectsGO.transform);
var rainGO = Object.Instantiate(_rainEmitterPrefab, effectsGO.transform);
rainGO.name = "RainEmitter";
rainGO.transform.position = planetGO.transform.position;
@ -74,7 +74,7 @@ namespace NewHorizons.Builder.Atmosphere
snowGO.transform.position = planetGO.transform.position;
for (int i = 0; i < 5; i++)
{
var snowEmitter = GameObject.Instantiate(_snowEmitterPrefab, snowGO.transform);
var snowEmitter = Object.Instantiate(_snowEmitterPrefab, snowGO.transform);
snowEmitter.name = "SnowEmitter";
snowEmitter.transform.position = planetGO.transform.position;

View File

@ -134,11 +134,11 @@ namespace NewHorizons.Builder.Body
if (config.vinePrefab == VinePrefabType.None)
{
// Replace batched collision with our own if removing vines
GameObject.Destroy(geometry.FindChild("BatchedGroup"));
Object.Destroy(geometry.FindChild("BatchedGroup"));
var geoOtherComponentsGroup = geometry.FindChild("OtherComponentsGroup");
var dimensionWalls = geoOtherComponentsGroup.FindChild("Terrain_DB_BrambleSphere_Outer_v2");
dimensionWalls.transform.parent = geometry.transform;
GameObject.Destroy(geoOtherComponentsGroup);
Object.Destroy(geoOtherComponentsGroup);
var newCollider = _wallCollision.InstantiateInactive();
newCollider.transform.parent = dimensionWalls.transform;

View File

@ -36,12 +36,12 @@ namespace NewHorizons.Builder.Body
var radius = module.radius;
var newCloak = GameObject.Instantiate(_prefab, sector?.transform ?? planetGO.transform);
var newCloak = Object.Instantiate(_prefab, sector?.transform ?? planetGO.transform);
newCloak.transform.position = planetGO.transform.position;
newCloak.transform.name = "CloakingField";
newCloak.transform.localScale = Vector3.one * radius;
GameObject.Destroy(newCloak.GetComponent<PlayerCloakEntryRedirector>());
Object.Destroy(newCloak.GetComponent<PlayerCloakEntryRedirector>());
var cloakFieldController = newCloak.GetComponent<CloakFieldController>();
cloakFieldController._cloakScaleDist = radius * 2000 / 3000f;

View File

@ -91,13 +91,13 @@ namespace NewHorizons.Builder.Body
controller.SetScaleCurve(cometTailModule.curve);
var dustTail = GameObject.Instantiate(_dustPrefab, rootObj.transform).Rename("DustTail");
var dustTail = Object.Instantiate(_dustPrefab, rootObj.transform).Rename("DustTail");
dustTail.transform.localPosition = Vector3.zero;
dustTail.transform.localRotation = Quaternion.Euler(90, 90, 0);
dustTail.SetActive(true);
controller.dustTail = dustTail;
var gasTail = GameObject.Instantiate(_gasPrefab, rootObj.transform).Rename("GasTail");
var gasTail = Object.Instantiate(_gasPrefab, rootObj.transform).Rename("GasTail");
gasTail.transform.localPosition = Vector3.zero;
gasTail.transform.localRotation = Quaternion.Euler(90, 90, 0);
gasTail.SetActive(true);

View File

@ -68,15 +68,15 @@ namespace NewHorizons.Builder.Body
scaleRoot.transform.localPosition = Vector3.zero;
scaleRoot.transform.localScale = new Vector3(1, 1, 1);
var proxyGO = GameObject.Instantiate(_proxySandFunnel, scaleRoot.transform);
var proxyGO = Object.Instantiate(_proxySandFunnel, scaleRoot.transform);
proxyGO.name = "Proxy_Funnel";
proxyGO.SetActive(true);
var geoGO = GameObject.Instantiate(_geoSandFunnel, scaleRoot.transform);
var geoGO = Object.Instantiate(_geoSandFunnel, scaleRoot.transform);
geoGO.name = "Geo_Funnel";
geoGO.SetActive(true);
var volumesGO = GameObject.Instantiate(_volumesSandFunnel, scaleRoot.transform);
var volumesGO = Object.Instantiate(_volumesSandFunnel, scaleRoot.transform);
volumesGO.name = "Volumes_Funnel";
volumesGO.SetActive(true);
var sfv = volumesGO.GetComponentInChildren<SimpleFluidVolume>();
@ -90,7 +90,7 @@ namespace NewHorizons.Builder.Body
case FunnelType.Water:
sfv._fluidType = FluidVolume.Type.WATER;
GameObject.Destroy(geoGO.transform.Find("Effects_HT_SandColumn/SandColumn_Interior").gameObject);
Object.Destroy(geoGO.transform.Find("Effects_HT_SandColumn/SandColumn_Interior").gameObject);
var waterMaterials = _waterMaterials;
var materials = new Material[waterMaterials.Length];
@ -138,7 +138,7 @@ namespace NewHorizons.Builder.Body
case FunnelType.Star:
sfv._fluidType = FluidVolume.Type.PLASMA;
GameObject.Destroy(geoGO.transform.Find("Effects_HT_SandColumn/SandColumn_Interior").gameObject);
Object.Destroy(geoGO.transform.Find("Effects_HT_SandColumn/SandColumn_Interior").gameObject);
var lavaMaterial = new Material(_lavaMaterial);
lavaMaterial.mainTextureOffset = new Vector2(0.1f, 0.2f);

View File

@ -42,7 +42,7 @@ namespace NewHorizons.Builder.Body
moltenCore.transform.position = planetGO.transform.position;
moltenCore.transform.localScale = Vector3.one * module.size;
var lavaSphere = GameObject.Instantiate(_lavaSphere, moltenCore.transform);
var lavaSphere = Object.Instantiate(_lavaSphere, moltenCore.transform);
lavaSphere.transform.localScale = Vector3.one;
lavaSphere.transform.name = "LavaSphere";
lavaSphere.GetComponent<MeshRenderer>().material.SetFloat(HeightScale, 150f * multiplier);
@ -54,7 +54,7 @@ namespace NewHorizons.Builder.Body
var sectorCullGroup = lavaSphere.GetComponent<SectorCullGroup>();
sectorCullGroup.SetSector(sector);
var moltenCoreProxy = GameObject.Instantiate(_moltenCoreProxy, moltenCore.transform); ;
var moltenCoreProxy = Object.Instantiate(_moltenCoreProxy, moltenCore.transform); ;
moltenCoreProxy.name = "MoltenCore_Proxy";
moltenCoreProxy.SetActive(true);
@ -70,7 +70,7 @@ namespace NewHorizons.Builder.Body
sectorProxy._renderers = new List<Renderer> { proxyLavaSphere.GetComponent<MeshRenderer>() };
sectorProxy.SetSector(sector);
var destructionVolume = GameObject.Instantiate(_destructionVolume, moltenCore.transform);
var destructionVolume = Object.Instantiate(_destructionVolume, moltenCore.transform);
destructionVolume.name = "DestructionVolume";
destructionVolume.GetComponent<SphereCollider>().radius = 1;
destructionVolume.SetActive(true);

View File

@ -54,7 +54,7 @@ namespace NewHorizons.Builder.Body
var success = SharedMake(planetGO, rootProxy, proxyController, body);
if (!success)
{
GameObject.Destroy(proxy);
UnityEngine.Object.Destroy(proxy);
return;
}
@ -215,8 +215,8 @@ namespace NewHorizons.Builder.Body
}
// Remove all collisions if there are any
foreach (var col in proxy.GetComponentsInChildren<Collider>()) GameObject.Destroy(col);
foreach (var col in proxy.GetComponentsInChildren<OWCollider>()) GameObject.Destroy(col);
foreach (var col in proxy.GetComponentsInChildren<Collider>()) UnityEngine.Object.Destroy(col);
foreach (var col in proxy.GetComponentsInChildren<OWCollider>()) UnityEngine.Object.Destroy(col);
foreach (var renderer in proxy.GetComponentsInChildren<Renderer>())
{
@ -267,7 +267,7 @@ namespace NewHorizons.Builder.Body
sphereGO.transform.localScale = Vector3.one * size;
sphereGO.transform.position = rootObj.transform.position;
GameObject.Destroy(sphereGO.GetComponent<Collider>());
UnityEngine.Object.Destroy(sphereGO.GetComponent<Collider>());
sphereGO.GetComponent<MeshRenderer>().material.color = color;

View File

@ -32,7 +32,7 @@ namespace NewHorizons.Builder.Body
var sandGO = new GameObject("Sand");
sandGO.SetActive(false);
var sandSphere = GameObject.Instantiate(_sandSphere, sandGO.transform);
var sandSphere = Object.Instantiate(_sandSphere, sandGO.transform);
sandSphere.name = "Sphere";
sandSphere.SetActive(true);
if (module.tint != null)
@ -46,20 +46,20 @@ namespace NewHorizons.Builder.Body
new Material(sandMaterials[0]),
new Material(sandMaterials[1])
};
GameObject.Destroy(oldMR);
Object.Destroy(oldMR);
sandMR.sharedMaterials[0].color = module.tint.ToColor();
sandMR.sharedMaterials[1].color = module.tint.ToColor();
}
var collider = GameObject.Instantiate(_sandCollider, sandGO.transform);
var collider = Object.Instantiate(_sandCollider, sandGO.transform);
collider.name = "Collider";
collider.SetActive(true);
var occlusionSphere = GameObject.Instantiate(_sandOcclusion, sandGO.transform);
var occlusionSphere = Object.Instantiate(_sandOcclusion, sandGO.transform);
occlusionSphere.name = "Occlusion";
occlusionSphere.SetActive(true);
var proxyShadowCasterGO = GameObject.Instantiate(_sandProxyShadowCaster, sandGO.transform);
var proxyShadowCasterGO = Object.Instantiate(_sandProxyShadowCaster, sandGO.transform);
proxyShadowCasterGO.name = "ProxyShadowCaster";
var proxyShadowCaster = proxyShadowCasterGO.GetComponent<ProxyShadowCaster>();
proxyShadowCaster.SetSuperGroup(sandGO.GetComponent<ProxyShadowCasterSuperGroup>());

View File

@ -167,7 +167,7 @@ namespace NewHorizons.Builder.Body
OWAudioSource oneShotOWAudioSource = null;
var singularityAmbience = GameObject.Instantiate(_blackHoleAmbience, singularity.transform);
var singularityAmbience = Object.Instantiate(_blackHoleAmbience, singularity.transform);
singularityAmbience.name = polarity ? "BlackHoleAmbience" : "WhiteHoleAmbience";
singularityAmbience.SetActive(true);
singularityAmbience.GetComponent<SectorAudioGroup>().SetSector(sector);
@ -202,7 +202,7 @@ namespace NewHorizons.Builder.Body
}
else
{
var blackHoleOneShot = GameObject.Instantiate(_blackHoleEmissionOneShot, singularity.transform);
var blackHoleOneShot = Object.Instantiate(_blackHoleEmissionOneShot, singularity.transform);
blackHoleOneShot.name = "BlackHoleEmissionOneShot";
blackHoleOneShot.SetActive(true);
oneShotOWAudioSource = blackHoleOneShot.GetComponent<OWAudioSource>();
@ -211,7 +211,7 @@ namespace NewHorizons.Builder.Body
oneShotAudioSource.minDistance = horizon;
if (sizeController != null) sizeController.oneShotAudioSource = oneShotAudioSource;
var blackHoleVolume = GameObject.Instantiate(_blackHoleVolume, singularity.transform);
var blackHoleVolume = Object.Instantiate(_blackHoleVolume, singularity.transform);
blackHoleVolume.name = "BlackHoleVolume";
blackHoleVolume.SetActive(true);
var bhVolume = blackHoleVolume.GetComponent<BlackHoleVolume>();
@ -226,7 +226,7 @@ namespace NewHorizons.Builder.Body
{
foreach (var renderer in blackHoleVolume.GetComponentsInChildren<ParticleSystemRenderer>(true))
{
UnityEngine.Object.Destroy(renderer);
Object.Destroy(renderer);
}
});
}
@ -234,7 +234,7 @@ namespace NewHorizons.Builder.Body
}
else
{
GameObject whiteHoleVolumeGO = GameObject.Instantiate(_whiteHoleVolume);
GameObject whiteHoleVolumeGO = Object.Instantiate(_whiteHoleVolume);
whiteHoleVolumeGO.transform.parent = singularity.transform;
whiteHoleVolumeGO.transform.localPosition = Vector3.zero;
whiteHoleVolumeGO.transform.localScale = Vector3.one;

View File

@ -48,7 +48,7 @@ namespace NewHorizons.Builder.Body
if (_starAtmosphere == null) _starAtmosphere = SearchUtilities.Find("Sun_Body/Atmosphere_SUN").InstantiateInactive().Rename("Prefab_Atmosphere_Star").DontDestroyOnLoad();
if (_starAmbientLight == null) _starAmbientLight = SearchUtilities.Find("Sun_Body/AmbientLight_SUN").InstantiateInactive().Rename("Prefab_AmbientLight_Star").DontDestroyOnLoad();
if (_sunLight == null) _sunLight = SearchUtilities.Find("Sun_Body/Sector_SUN/Effects_SUN/SunLight").InstantiateInactive().Rename("Prefab_SunLight").DontDestroyOnLoad();
if (_starProxyAtmosphere == null) _starProxyAtmosphere = GameObject.FindObjectOfType<DistantProxyManager>()._sunProxyPrefab.FindChild("Sun_Proxy_Body/Atmosphere_SUN").InstantiateInactive().Rename("Prefab_ProxyAtmosphere_Star").DontDestroyOnLoad();
if (_starProxyAtmosphere == null) _starProxyAtmosphere = Object.FindObjectOfType<DistantProxyManager>()._sunProxyPrefab.FindChild("Sun_Proxy_Body/Atmosphere_SUN").InstantiateInactive().Rename("Prefab_ProxyAtmosphere_Star").DontDestroyOnLoad();
if (_starSurface == null) _starSurface = SearchUtilities.Find("Sun_Body/Sector_SUN/Geometry_SUN/Surface").InstantiateInactive().Rename("Prefab_Surface_Star").DontDestroyOnLoad();
if (_starSolarFlareEmitter == null) _starSolarFlareEmitter = SearchUtilities.Find("Sun_Body/Sector_SUN/Effects_SUN/SolarFlareEmitter").InstantiateInactive().Rename("Prefab_SolarFlareEmitter_Star").DontDestroyOnLoad();
if (_supernovaPrefab == null) _supernovaPrefab = SearchUtilities.Find("Sun_Body/Sector_SUN/Effects_SUN/Supernova").InstantiateInactive().Rename("Prefab_Supernova").DontDestroyOnLoad();
@ -69,7 +69,7 @@ namespace NewHorizons.Builder.Body
var sunSurfaceAudio = sunAudio.GetComponentInChildren<SunSurfaceAudioController>();
var surfaceAudio = sunSurfaceAudio.gameObject.AddComponent<StarSurfaceAudioController>();
surfaceAudio._size = starModule.size;
GameObject.Destroy(sunSurfaceAudio);
Object.Destroy(sunSurfaceAudio);
surfaceAudio.SetSector(sector);
sunAudio.name = "Audio_Star";
@ -96,7 +96,7 @@ namespace NewHorizons.Builder.Body
var fog = sunAtmosphere.transform.Find("FogSphere").GetComponent<PlanetaryFogController>();
fog.transform.localScale = Vector3.one;
fog.fogRadius = starModule.size * OuterRadiusRatio;
fog.lodFadeDistance = fog.fogRadius * (StarBuilder.OuterRadiusRatio - 1f);
fog.lodFadeDistance = fog.fogRadius * (OuterRadiusRatio - 1f);
fog.fogImpostor.material.SetFloat(Radius, starModule.size * OuterRadiusRatio);
if (starModule.tint != null)
@ -416,7 +416,7 @@ namespace NewHorizons.Builder.Body
stellarDeath.shockwaveAlpha = supernova._shockwaveAlpha;
stellarDeath.shockwaveScale = supernova._shockwaveScale;
stellarDeath.supernovaMaterial = supernova._supernovaMaterial;
GameObject.Destroy(supernova);
Object.Destroy(supernova);
if (starModule.supernovaTint != null)
{

View File

@ -123,7 +123,7 @@ namespace NewHorizons.Builder.Body
fluidVolume._density = module.density;
fluidVolume._layer = LayerMask.NameToLayer("BasicEffectVolume");
var fogGO = GameObject.Instantiate(_oceanFog, waterGO.transform);
var fogGO = Object.Instantiate(_oceanFog, waterGO.transform);
fogGO.name = "OceanFog";
fogGO.transform.localPosition = Vector3.zero;
fogGO.transform.localScale = Vector3.one;

View File

@ -12,7 +12,7 @@ namespace NewHorizons.Builder.General
var ambientLight = Main.Instance.CurrentStarSystem == "EyeOfTheUniverse" ? SearchUtilities.Find("EyeOfTheUniverse_Body/Sector_EyeOfTheUniverse/SixthPlanet_Root/QuantumMoonProxy_Pivot/QuantumMoonProxy_Root/MoonState_Root/AmbientLight_QM") : SearchUtilities.Find("QuantumMoon_Body/AmbientLight_QM");
if (ambientLight == null) return null;
GameObject lightGO = GameObject.Instantiate(ambientLight, sector?.transform ?? planetGO.transform);
GameObject lightGO = Object.Instantiate(ambientLight, sector?.transform ?? planetGO.transform);
lightGO.transform.position = config.position == null ? planetGO.transform.position : planetGO.transform.TransformPoint(config.position);
lightGO.name = "AmbientLight";

View File

@ -195,7 +195,7 @@ namespace NewHorizons.Builder.Props
var fogLight = brambleNode.GetComponent<FogLight>();
// This node comes with Feldspar's signal, we don't want that though
GameObject.Destroy(brambleNode.FindChild("Signal_Harmonica"));
Object.Destroy(brambleNode.FindChild("Signal_Harmonica"));
// Fix some components
fogLight._parentBody = go.GetComponent<OWRigidbody>();

View File

@ -29,7 +29,7 @@ namespace NewHorizons.Builder.Props
{
foreach (var prefab in _fixedPrefabCache.Values)
{
GameObject.Destroy(prefab.prefab);
UnityEngine.Object.Destroy(prefab.prefab);
}
_fixedPrefabCache.Clear();
_detailInfoToCorrespondingSpawnedGameObject.Clear();
@ -189,7 +189,7 @@ namespace NewHorizons.Builder.Props
child.parent = newDetailGO.transform;
}
// Have to destroy it right away, else parented props might get attached to the old one
GameObject.DestroyImmediate(prop);
UnityEngine.Object.DestroyImmediate(prop);
prop = newDetailGO;
}
@ -225,7 +225,7 @@ namespace NewHorizons.Builder.Props
// renderers/colliders get enabled later so we dont have to do that here
if (keepLoaded && component is SectorCullGroup or SectorCollisionGroup or SectorLightsCullGroup)
{
Component.DestroyImmediate(component);
UnityEngine.Object.DestroyImmediate(component);
return;
}
@ -283,7 +283,7 @@ namespace NewHorizons.Builder.Props
{
if (component is FogLight or SectoredMonoBehaviour or ISectorGroup)
{
GameObject.DestroyImmediate(component);
UnityEngine.Object.DestroyImmediate(component);
return true;
}
return false;
@ -306,7 +306,7 @@ namespace NewHorizons.Builder.Props
// I forget why this is here
else if (component is GhostIK or GhostEffects)
{
Component.DestroyImmediate(component);
UnityEngine.Object.DestroyImmediate(component);
return;
}
else if (component is DarkMatterVolume)

View File

@ -65,7 +65,7 @@ namespace NewHorizons.Builder.Props
if (_arcPrefabs == null || _childArcPrefabs == null)
{
// Just take every scroll and get the first arc
var existingArcs = GameObject.FindObjectsOfType<ScrollItem>()
var existingArcs = UnityEngine.Object.FindObjectsOfType<ScrollItem>()
.Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject)
.Where(x => x != null)
.OrderBy(x => x.transform.GetPath()) // order by path so game updates dont break things
@ -87,7 +87,7 @@ namespace NewHorizons.Builder.Props
if (_ghostArcPrefabs == null)
{
var existingGhostArcs = GameObject.FindObjectsOfType<GhostWallText>()
var existingGhostArcs = UnityEngine.Object.FindObjectsOfType<GhostWallText>()
.Select(x => x?._textLine?.gameObject)
.Where(x => x != null)
.OrderBy(x => x.transform.GetPath()) // order by path so game updates dont break things
@ -245,7 +245,7 @@ namespace NewHorizons.Builder.Props
var scrollItem = customScroll.GetComponent<ScrollItem>();
// Idk why this thing is always around
GameObject.Destroy(customScroll.transform.Find("Arc_BH_City_Forum_2").gameObject);
UnityEngine.Object.Destroy(customScroll.transform.Find("Arc_BH_City_Forum_2").gameObject);
// This variable is the bane of my existence i dont get it
scrollItem._nomaiWallText = nomaiWallText;

View File

@ -208,7 +208,7 @@ namespace NewHorizons.Builder.Props
void Update()
{
if (meshFilter == null && skinnedMeshRenderer == null) { NHLogger.LogVerbose("Useless BoxShapeFixer, destroying"); GameObject.DestroyImmediate(this); }
if (meshFilter == null && skinnedMeshRenderer == null) { NHLogger.LogVerbose("Useless BoxShapeFixer, destroying"); DestroyImmediate(this); }
Mesh sharedMesh = null;
if (meshFilter != null) sharedMesh = meshFilter.sharedMesh;
@ -220,7 +220,7 @@ namespace NewHorizons.Builder.Props
shape.size = sharedMesh.bounds.size;
shape.center = sharedMesh.bounds.center;
GameObject.DestroyImmediate(this);
DestroyImmediate(this);
}
}
}

View File

@ -14,7 +14,7 @@ namespace NewHorizons.Builder.Props
{
if (_prefab == null)
{
_prefab = GameObject.FindObjectOfType<RaftController>()?.gameObject?.InstantiateInactive()?.Rename("Raft_Body_Prefab")?.DontDestroyOnLoad();
_prefab = Object.FindObjectOfType<RaftController>()?.gameObject?.InstantiateInactive()?.Rename("Raft_Body_Prefab")?.DontDestroyOnLoad();
if (_prefab == null)
{
NHLogger.LogWarning($"Tried to make a raft but couldn't. Do you have the DLC installed?");

View File

@ -65,7 +65,7 @@ namespace NewHorizons.Builder.Props
quad.AddComponent<OWRenderer>();
quad.GetComponent<MeshRenderer>().sharedMaterial = _decalMaterial;
quad.name = "AstroBodySymbolRenderer";
GameObject.DestroyImmediate(AstroBodySymbolRenderer);
UnityEngine.Object.DestroyImmediate(AstroBodySymbolRenderer);
}
if (_whiteboardPrefab == null)
@ -86,7 +86,7 @@ namespace NewHorizons.Builder.Props
quadW.AddComponent<OWRenderer>();
quadW.GetComponent<MeshRenderer>().sharedMaterial = _decalMaterial;
quadW.name = "AstroBodySymbolRenderer";
GameObject.DestroyImmediate(AstroBodySymbolRendererW);
UnityEngine.Object.DestroyImmediate(AstroBodySymbolRendererW);
}
if (_shareStonePrefab == null)
@ -109,7 +109,7 @@ namespace NewHorizons.Builder.Props
TransformAnimator transformAnimator = animRoot.AddComponent<TransformAnimator>();
item._animator = transformAnimator;
OWRenderer renderer = SearchUtilities.FindResourceOfTypeAndName<OWRenderer>("Props_NOM_SharedStone");
if (renderer != null) GameObject.Instantiate(renderer.gameObject, animRoot.transform);
if (renderer != null) UnityEngine.Object.Instantiate(renderer.gameObject, animRoot.transform);
GameObject planetDecal = GameObject.CreatePrimitive(PrimitiveType.Quad);
planetDecal.name = "PlanetDecal";
planetDecal.transform.parent = animRoot.transform;
@ -137,7 +137,7 @@ namespace NewHorizons.Builder.Props
{
try
{
RemoteBuilder.MakePlatform(go, sector, id, decal, info.platform, mod);
MakePlatform(go, sector, id, decal, info.platform, mod);
}
catch (Exception ex)
{
@ -149,7 +149,7 @@ namespace NewHorizons.Builder.Props
{
try
{
RemoteBuilder.MakeWhiteboard(go, sector, id, decal, info.whiteboard, nhBody);
MakeWhiteboard(go, sector, id, decal, info.whiteboard, nhBody);
}
catch (Exception ex)
{
@ -163,7 +163,7 @@ namespace NewHorizons.Builder.Props
{
try
{
RemoteBuilder.MakeStone(go, sector, id, decal, stoneInfo, mod);
MakeStone(go, sector, id, decal, stoneInfo, mod);
}
catch (Exception ex)
{

View File

@ -139,7 +139,7 @@ namespace NewHorizons.Builder.Props
prop.SetActive(true);
}
GameObject.Destroy(scatterPrefab);
Object.Destroy(scatterPrefab);
}
}
}

View File

@ -148,12 +148,12 @@ namespace NewHorizons.Builder.Props.TranslatorText
this.outerWidth = profile.outerWidth;
this.uvScale = profile.uvScale;
this.uvOffset = UnityEngine.Random.value;
this.uvOffset = Random.value;
}
public override void Randomize() {
base.Randomize();
uvOffset = UnityEngine.Random.value; // this way even two spirals that are exactly the same shape will look different (this changes the starting point of the handwriting texture)
uvOffset = Random.value; // this way even two spirals that are exactly the same shape will look different (this changes the starting point of the handwriting texture)
}
internal void updateMesh() {
@ -288,11 +288,11 @@ namespace NewHorizons.Builder.Props.TranslatorText
}
public virtual void Randomize() {
this.a = UnityEngine.Random.Range(profile.a.x, profile.a.y);
this.b = UnityEngine.Random.Range(profile.b.x, profile.b.y);
this.endS = UnityEngine.Random.Range(profile.endS.x, profile.endS.y);
this.startS = UnityEngine.Random.Range(profile.startS.x, profile.startS.y);
this.scale = UnityEngine.Random.Range(profile.skeletonScale.x, profile.skeletonScale.y);
this.a = Random.Range(profile.a.x, profile.a.y);
this.b = Random.Range(profile.b.x, profile.b.y);
this.endS = Random.Range(profile.endS.x, profile.endS.y);
this.startS = Random.Range(profile.startS.x, profile.startS.y);
this.scale = Random.Range(profile.skeletonScale.x, profile.skeletonScale.y);
}
internal virtual void updateChild(MathematicalSpiral child) {

View File

@ -176,7 +176,7 @@ namespace NewHorizons.Builder.Props.TranslatorText
var scrollItem = customScroll.GetComponent<ScrollItem>();
// Idk why this thing is always around
GameObject.Destroy(customScroll.transform.Find("Arc_BH_City_Forum_2").gameObject);
UnityEngine.Object.Destroy(customScroll.transform.Find("Arc_BH_City_Forum_2").gameObject);
// This variable is the bane of my existence i dont get it
scrollItem._nomaiWallText = nomaiWallText;

View File

@ -28,7 +28,7 @@ namespace NewHorizons.Builder.Props
meteorLauncher._dynamicProbability = 0f;
var meteorPrefab = meteorLauncher._meteorPrefab.InstantiateInactive().Rename("Prefab_VM_MoltenMeteor").DontDestroyOnLoad();
var meteor = meteorPrefab.GetComponent<MeteorController>();
GameObject.DestroyImmediate(meteorPrefab.FindChild("ConstantDetectors"));
Object.DestroyImmediate(meteorPrefab.FindChild("ConstantDetectors"));
var detectors = meteorPrefab.FindChild("DynamicDetector");
var rigidbody = meteor.GetComponent<OWRigidbody>();
meteor._owRigidbody = rigidbody;

View File

@ -52,7 +52,7 @@ namespace NewHorizons.Builder.Props
_detailedReceiverPrefab.DontDestroyOnLoad();
GameObject.Destroy(_detailedReceiverPrefab.GetComponentInChildren<NomaiWarpStreaming>().gameObject);
Object.Destroy(_detailedReceiverPrefab.GetComponentInChildren<NomaiWarpStreaming>().gameObject);
}
if (_receiverPrefab == null)
@ -60,7 +60,7 @@ namespace NewHorizons.Builder.Props
_receiverPrefab = SearchUtilities.Find("SunStation_Body/Sector_SunStation/Sector_WarpModule/Interactables_WarpModule/Prefab_NOM_WarpReceiver")
.InstantiateInactive()
.DontDestroyOnLoad();
GameObject.Destroy(_receiverPrefab.GetComponentInChildren<NomaiWarpStreaming>().gameObject);
Object.Destroy(_receiverPrefab.GetComponentInChildren<NomaiWarpStreaming>().gameObject);
var structure = _platformContainerPrefab.Instantiate();
structure.transform.parent = _receiverPrefab.transform;
@ -74,7 +74,7 @@ namespace NewHorizons.Builder.Props
_transmitterPrefab = SearchUtilities.Find("TowerTwin_Body/Sector_TowerTwin/Sector_Tower_SS/Interactables_Tower_SS/Tower_SS_VisibleFrom_TowerTwin/Prefab_NOM_WarpTransmitter")
.InstantiateInactive()
.DontDestroyOnLoad();
GameObject.Destroy(_transmitterPrefab.GetComponentInChildren<NomaiWarpStreaming>().gameObject);
Object.Destroy(_transmitterPrefab.GetComponentInChildren<NomaiWarpStreaming>().gameObject);
var structure = _platformContainerPrefab.Instantiate();
structure.transform.parent = _transmitterPrefab.transform;

View File

@ -133,7 +133,7 @@ namespace NewHorizons.Builder.ShipLog
astroObject._image = revealedImage;
}
astroObject._unviewedObj = GameObject.Instantiate(unviewedReference, gameObject.transform, false);
astroObject._unviewedObj = UnityEngine.Object.Instantiate(unviewedReference, gameObject.transform, false);
astroObject._invisibleWhenHidden = body.Config.ShipLog?.mapMode?.invisibleWhenHidden ?? false;
Rect imageRect = astroObject._imageObj.GetComponent<RectTransform>().rect;

View File

@ -15,7 +15,7 @@ namespace NewHorizons.Components.Orbital
public override void InitializeLineRenderer()
{
base.GetComponent<LineRenderer>().positionCount = this._numVerts;
GetComponent<LineRenderer>().positionCount = this._numVerts;
}
public override void OnValidate()
@ -24,7 +24,7 @@ namespace NewHorizons.Components.Orbital
{
_numVerts = Mathf.Clamp(_numVerts, 0, 4096);
}
if (base.GetComponent<LineRenderer>().positionCount != this._numVerts)
if (GetComponent<LineRenderer>().positionCount != this._numVerts)
{
InitializeLineRenderer();
}
@ -46,7 +46,7 @@ namespace NewHorizons.Components.Orbital
transform.localRotation = Quaternion.Euler(270, 90, 0);
base.enabled = false;
enabled = false;
}
public override void Update()
@ -58,7 +58,7 @@ namespace NewHorizons.Components.Orbital
// If it has nothing to orbit then why is this here
if (primary == null || !primary.gameObject.activeSelf)
{
base.enabled = false;
enabled = false;
return;
}

View File

@ -34,7 +34,7 @@ namespace NewHorizons.Components.Orbital
base.Start();
_vertices = new Vector3[_numVerts];
base.enabled = true;
enabled = true;
_lineRenderer.enabled = false;
}
@ -75,8 +75,8 @@ namespace NewHorizons.Components.Orbital
_vertices[0] = transform.parent.position - origin;
_lineRenderer.SetPositions(_vertices);
base.transform.position = origin;
base.transform.rotation = Quaternion.AngleAxis(0f, Vector3.up);
transform.position = origin;
transform.rotation = Quaternion.AngleAxis(0f, Vector3.up);
float num2 = DistanceToTrackingOrbitLine(Locator.GetActiveCamera().transform.position);
float widthMultiplier = Mathf.Min(num2 * (_lineWidth / 1000f), _maxLineWidth);
@ -108,8 +108,8 @@ namespace NewHorizons.Components.Orbital
var primary = _astroObject.GetPrimaryBody();
Vector3 origin = primary == null ? Locator.GetRootTransform().position : primary.transform.position;
base.transform.position = origin;
base.transform.rotation = Quaternion.AngleAxis(0f, Vector3.up);
transform.position = origin;
transform.rotation = Quaternion.AngleAxis(0f, Vector3.up);
for (int i = _numVerts - 1; i > 0; i--)
{

View File

@ -136,7 +136,7 @@ namespace NewHorizons.Components.Quantum
num += _probabilities[j];
}
}
int num2 = UnityEngine.Random.Range(0, num);
int num2 = Random.Range(0, num);
int num3 = 0;
int num4 = 0;
foreach (int k in indices)

View File

@ -19,8 +19,8 @@ namespace NewHorizons.Components.Volumes
public void Start()
{
_gameOverController = GameObject.FindObjectOfType<GameOverController>();
_playerCameraEffectController = GameObject.FindObjectOfType<PlayerCameraEffectController>();
_gameOverController = FindObjectOfType<GameOverController>();
_playerCameraEffectController = FindObjectOfType<PlayerCameraEffectController>();
}
public override void OnTriggerVolumeEntry(GameObject hitObj)

View File

@ -52,15 +52,15 @@ namespace NewHorizons.Handlers
starController.Intensity = 0.9859f;
starController.SunColor = new Color(1f, 0.8845f, 0.6677f, 1f);
var starLightGO = GameObject.Instantiate(sun.GetComponentInChildren<SunLightController>().gameObject);
var starLightGO = UnityEngine.Object.Instantiate(sun.GetComponentInChildren<SunLightController>().gameObject);
foreach (var comp in starLightGO.GetComponents<Component>())
{
if (!(comp is SunLightController) && !(comp is SunLightParamUpdater) && !(comp is Light) && !(comp is Transform))
{
GameObject.Destroy(comp);
UnityEngine.Object.Destroy(comp);
}
}
GameObject.Destroy(starLightGO.GetComponent<Light>());
UnityEngine.Object.Destroy(starLightGO.GetComponent<Light>());
starLightGO.name = "StarLightController";
starLightGO.AddComponent<SunLightEffectsController>();
@ -715,7 +715,7 @@ namespace NewHorizons.Handlers
// We need these for later
var children = AstroObjectLocator.GetChildren(ao).Concat(AstroObjectLocator.GetMoons(ao)).ToArray();
AstroObjectLocator.DeregisterCustomAstroObject(ao);
GameObject.Destroy(ao);
UnityEngine.Object.Destroy(ao);
Locator.RegisterAstroObject(newAO);
AstroObjectLocator.RegisterCustomAstroObject(newAO);
@ -727,7 +727,7 @@ namespace NewHorizons.Handlers
// QM and stuff don't have orbit lines
var orbitLine = go.GetComponentInChildren<OrbitLine>()?.gameObject;
if (orbitLine != null) GameObject.Destroy(orbitLine);
if (orbitLine != null) UnityEngine.Object.Destroy(orbitLine);
var isMoon = newAO.GetAstroObjectType() is AstroObject.Type.Moon or AstroObject.Type.Satellite or AstroObject.Type.SpaceStation;
if (body.Config.Orbit.showOrbitLine) OrbitlineBuilder.Make(go, newAO, isMoon, body.Config);

View File

@ -107,7 +107,7 @@ namespace NewHorizons.Handlers
RemoveBody(AstroObjectLocator.GetAstroObject(AstroObject.Name.WhiteHole.ToString()), delete, toDestroy);
// Might prevent leftover fragments from existing
// Might also prevent people from using their own detachable fragments however
foreach(var fragment in GameObject.FindObjectsOfType<DetachableFragment>())
foreach(var fragment in UnityEngine.Object.FindObjectsOfType<DetachableFragment>())
{
DisableBody(fragment.gameObject, delete);
}
@ -120,7 +120,7 @@ namespace NewHorizons.Handlers
case AstroObject.Name.GiantsDeep:
// Might prevent leftover jellyfish from existing
// Might also prevent people from using their own jellyfish however
foreach (var jelly in GameObject.FindObjectsOfType<JellyfishController>())
foreach (var jelly in UnityEngine.Object.FindObjectsOfType<JellyfishController>())
{
DisableBody(jelly.gameObject, delete);
}
@ -131,11 +131,11 @@ namespace NewHorizons.Handlers
// Always just fucking kill this one to stop THE WARP BUG!!!
DisableBody(SearchUtilities.Find("StreamingGroup_TH"), true);
foreach (var obj in GameObject.FindObjectsOfType<DayNightTracker>())
foreach (var obj in UnityEngine.Object.FindObjectsOfType<DayNightTracker>())
{
DisableBody(obj.gameObject, true);
}
foreach (var obj in GameObject.FindObjectsOfType<VillageMusicVolume>())
foreach (var obj in UnityEngine.Object.FindObjectsOfType<VillageMusicVolume>())
{
DisableBody(obj.gameObject, true);
}
@ -144,27 +144,27 @@ namespace NewHorizons.Handlers
var starController = ao.gameObject.GetComponent<StarController>();
SunLightEffectsController.RemoveStar(starController);
SunLightEffectsController.RemoveStarLight(ao.transform.Find("Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>());
GameObject.Destroy(starController);
UnityEngine.Object.Destroy(starController);
var audio = ao.GetComponentInChildren<SunSurfaceAudioController>();
GameObject.Destroy(audio);
UnityEngine.Object.Destroy(audio);
foreach (var owAudioSource in ao.GetComponentsInChildren<OWAudioSource>())
{
owAudioSource.Stop();
GameObject.Destroy(owAudioSource);
UnityEngine.Object.Destroy(owAudioSource);
}
foreach (var audioSource in ao.GetComponentsInChildren<AudioSource>())
{
audioSource.Stop();
GameObject.Destroy(audioSource);
UnityEngine.Object.Destroy(audioSource);
}
foreach (var sunProxy in GameObject.FindObjectsOfType<SunProxy>())
foreach (var sunProxy in UnityEngine.Object.FindObjectsOfType<SunProxy>())
{
NHLogger.LogVerbose($"Destroying SunProxy {sunProxy.gameObject.name}");
GameObject.Destroy(sunProxy.gameObject);
UnityEngine.Object.Destroy(sunProxy.gameObject);
}
// Stop the sun from breaking stuff when the supernova gets triggered
@ -203,7 +203,7 @@ namespace NewHorizons.Handlers
}
// Deal with proxies
foreach (var p in GameObject.FindObjectsOfType<ProxyOrbiter>())
foreach (var p in UnityEngine.Object.FindObjectsOfType<ProxyOrbiter>())
{
if (p._originalBody == ao.gameObject)
{
@ -215,18 +215,18 @@ namespace NewHorizons.Handlers
Delay.RunWhen(() => Main.IsSystemReady, () => DisableBody(ao.gameObject, delete));
foreach (ProxyBody proxy in GameObject.FindObjectsOfType<ProxyBody>())
foreach (ProxyBody proxy in UnityEngine.Object.FindObjectsOfType<ProxyBody>())
{
if (proxy?._realObjectTransform?.gameObject == ao.gameObject)
{
GameObject.Destroy(proxy.gameObject);
UnityEngine.Object.Destroy(proxy.gameObject);
}
}
}
public static void RemoveAllProxies()
{
GameObject.Destroy(GameObject.FindObjectOfType<DistantProxyManager>().gameObject);
UnityEngine.Object.Destroy(UnityEngine.Object.FindObjectOfType<DistantProxyManager>().gameObject);
foreach (var name in _solarSystemBodies)
{
@ -274,7 +274,7 @@ namespace NewHorizons.Handlers
if (delete)
{
GameObject.Destroy(go);
UnityEngine.Object.Destroy(go);
}
else
{
@ -294,8 +294,8 @@ namespace NewHorizons.Handlers
var distantProxy = SearchUtilities.Find(name + "_DistantProxy", false);
var distantProxyClone = SearchUtilities.Find(name + "_DistantProxy(Clone)", false);
if (distantProxy != null) GameObject.Destroy(distantProxy.gameObject);
if (distantProxyClone != null) GameObject.Destroy(distantProxyClone.gameObject);
if (distantProxy != null) UnityEngine.Object.Destroy(distantProxy.gameObject);
if (distantProxyClone != null) UnityEngine.Object.Destroy(distantProxyClone.gameObject);
if (distantProxy == null && distantProxyClone == null)
NHLogger.LogVerbose($"Couldn't find proxy for {name}");

View File

@ -35,7 +35,7 @@ namespace NewHorizons.Handlers
ShipLogStarChartMode = starChartLog.AddComponent<ShipLogStarChartMode>();
GameObject.Instantiate(reticleImage, starChartLog.transform);
Object.Instantiate(reticleImage, starChartLog.transform);
var scaleRoot = new GameObject("ScaleRoot");
scaleRoot.transform.parent = starChartLog.transform;

View File

@ -156,11 +156,11 @@ namespace NewHorizons.Handlers
}
}
var pivot = GameObject.Instantiate(SearchUtilities.Find("Scene/Background/PlanetPivot"), SearchUtilities.Find("Scene/Background").transform);
var pivot = Object.Instantiate(SearchUtilities.Find("Scene/Background/PlanetPivot"), SearchUtilities.Find("Scene/Background").transform);
pivot.GetComponent<RotateTransform>()._degreesPerSecond = 10f;
foreach (Transform child in pivot.transform)
{
GameObject.Destroy(child.gameObject);
Object.Destroy(child.gameObject);
}
pivot.name = "Pivot";

View File

@ -1,12 +1,11 @@
using UnityEngine;
using NewHorizons.Utility;
using static NewHorizons.Main;
using NewHorizons.Builder.Props;
using NewHorizons.Utility.OWML;
using NewHorizons.Utility.OuterWilds;
using NewHorizons.Components.Vessel;
using NewHorizons.Components.EyeOfTheUniverse;
using NewHorizons.Components.Vessel;
using NewHorizons.Utility;
using NewHorizons.Utility.OuterWilds;
using NewHorizons.Utility.OWML;
using UnityEngine;
using static NewHorizons.Main;
namespace NewHorizons.Handlers
{
@ -21,7 +20,7 @@ namespace NewHorizons.Handlers
public static void Initialize()
{
VesselPrefab = Main.NHPrivateAssetBundle.LoadAsset<GameObject>("Vessel_Body");
VesselPrefab = NHPrivateAssetBundle.LoadAsset<GameObject>("Vessel_Body");
}
public static bool IsVesselPresentAndActive()
@ -62,7 +61,7 @@ namespace NewHorizons.Handlers
public static void TeleportToVessel()
{
var playerSpawner = GameObject.FindObjectOfType<PlayerSpawner>();
var playerSpawner = Object.FindObjectOfType<PlayerSpawner>();
playerSpawner.DebugWarp(_vesselSpawnPoint);
Builder.General.SpawnPointBuilder.SuitUp();
@ -110,34 +109,34 @@ namespace NewHorizons.Handlers
GameObject warpBH = WarpPlatform.transform.Find("BlackHole").gameObject;
GameObject warpWH = WarpPlatform.transform.Find("WhiteHole").gameObject;
GameObject sourceBH = GameObject.Instantiate(warpBH, vesselWarpController._sourceWarpPlatform.transform, false);
GameObject sourceBH = Object.Instantiate(warpBH, vesselWarpController._sourceWarpPlatform.transform, false);
sourceBH.name = "BlackHole";
vesselWarpController._sourceWarpPlatform._blackHole = sourceBH.GetComponentInChildren<SingularityController>();
vesselWarpController._sourceWarpPlatform._blackHole.OnCollapse += vesselWarpController._sourceWarpPlatform.OnBlackHoleCollapse;
GameObject sourceWH = GameObject.Instantiate(warpWH, vesselWarpController._sourceWarpPlatform.transform, false);
GameObject sourceWH = Object.Instantiate(warpWH, vesselWarpController._sourceWarpPlatform.transform, false);
sourceWH.name = "WhiteHole";
vesselWarpController._sourceWarpPlatform._whiteHole = sourceWH.GetComponentInChildren<SingularityController>();
vesselWarpController._sourceWarpPlatform._whiteHole.OnCollapse += vesselWarpController._sourceWarpPlatform.OnWhiteHoleCollapse;
GameObject targetBH = GameObject.Instantiate(warpBH, vesselWarpController._targetWarpPlatform.transform, false);
GameObject targetBH = Object.Instantiate(warpBH, vesselWarpController._targetWarpPlatform.transform, false);
targetBH.name = "BlackHole";
vesselWarpController._targetWarpPlatform._blackHole = targetBH.GetComponentInChildren<SingularityController>();
vesselWarpController._targetWarpPlatform._blackHole.OnCollapse += vesselWarpController._targetWarpPlatform.OnBlackHoleCollapse;
GameObject targetWH = GameObject.Instantiate(warpWH, vesselWarpController._targetWarpPlatform.transform, false);
GameObject targetWH = Object.Instantiate(warpWH, vesselWarpController._targetWarpPlatform.transform, false);
targetWH.name = "WhiteHole";
vesselWarpController._targetWarpPlatform._whiteHole = targetWH.GetComponentInChildren<SingularityController>();
vesselWarpController._targetWarpPlatform._whiteHole.OnCollapse += vesselWarpController._targetWarpPlatform.OnWhiteHoleCollapse;
GameObject blackHole = SearchUtilities.Find("DB_VesselDimension_Body/Sector_VesselDimension/Sector_VesselBridge/Interactibles_VesselBridge/BlackHole");
GameObject newBlackHole = GameObject.Instantiate(blackHole, Vector3.zero, Quaternion.identity, singularityRoot.transform);
GameObject newBlackHole = Object.Instantiate(blackHole, Vector3.zero, Quaternion.identity, singularityRoot.transform);
newBlackHole.name = "BlackHole";
vesselWarpController._blackHole = newBlackHole.GetComponentInChildren<SingularityController>();
vesselWarpController._blackHoleOneShot = vesselWarpController._blackHole.transform.parent.Find("BlackHoleAudio_OneShot").GetComponent<OWAudioSource>();
GameObject whiteHole = SearchUtilities.Find("DB_VesselDimension_Body/Sector_VesselDimension/Sector_VesselBridge/Interactibles_VesselBridge/WhiteHole");
GameObject newWhiteHole = GameObject.Instantiate(whiteHole, Vector3.zero, Quaternion.identity, singularityRoot.transform);
GameObject newWhiteHole = Object.Instantiate(whiteHole, Vector3.zero, Quaternion.identity, singularityRoot.transform);
newWhiteHole.name = "WhiteHole";
vesselWarpController._whiteHole = newWhiteHole.GetComponentInChildren<SingularityController>();
vesselWarpController._whiteHoleOneShot = vesselWarpController._whiteHole.transform.parent.Find("WhiteHoleAudio_OneShot").GetComponent<OWAudioSource>();
@ -155,14 +154,14 @@ namespace NewHorizons.Handlers
else
{
vesselAO._owRigidbody = null;
UnityEngine.Object.DestroyImmediate(vesselObject.GetComponent<KinematicRigidbody>());
UnityEngine.Object.DestroyImmediate(vesselObject.GetComponent<CenterOfTheUniverseOffsetApplier>());
UnityEngine.Object.DestroyImmediate(vesselObject.GetComponent<OWRigidbody>());
UnityEngine.Object.DestroyImmediate(vesselObject.GetComponent<Rigidbody>());
Object.DestroyImmediate(vesselObject.GetComponent<KinematicRigidbody>());
Object.DestroyImmediate(vesselObject.GetComponent<CenterOfTheUniverseOffsetApplier>());
Object.DestroyImmediate(vesselObject.GetComponent<OWRigidbody>());
Object.DestroyImmediate(vesselObject.GetComponent<Rigidbody>());
var rfVolume = vesselObject.transform.Find("RFVolume");
if (rfVolume != null)
{
GameObject.Destroy(rfVolume.gameObject);
Object.Destroy(rfVolume.gameObject);
}
}
@ -182,7 +181,7 @@ namespace NewHorizons.Handlers
var zeroGVolume = vesselObject.transform.Find("Sector_VesselBridge/Volumes_VesselBridge/ZeroGVolume");
if (zeroGVolume != null)
{
GameObject.Destroy(zeroGVolume.gameObject);
Object.Destroy(zeroGVolume.gameObject);
}
}
@ -233,7 +232,7 @@ namespace NewHorizons.Handlers
{
if (core.GetWarpCoreType().Equals(WarpCoreType.Vessel))
{
var newCore = GameObject.Instantiate(core, AstroObjectLocator.GetAstroObject("Vessel Dimension")?.transform ?? Locator.GetPlayerBody()?.transform);
var newCore = Object.Instantiate(core, AstroObjectLocator.GetAstroObject("Vessel Dimension")?.transform ?? Locator.GetPlayerBody()?.transform);
newCore._visible = true;
foreach (OWRenderer render in newCore._renderers)
{

View File

@ -332,7 +332,7 @@ namespace NewHorizons
{
TimeLoopUtilities.SetSecondsElapsed(SecondsElapsedInLoop);
// Prevent the OPC from firing
var launchController = GameObject.FindObjectOfType<OrbitalProbeLaunchController>();
var launchController = FindObjectOfType<OrbitalProbeLaunchController>();
if (launchController != null)
{
GlobalMessenger<int>.RemoveListener("StartOfTimeLoop", launchController.OnStartOfTimeLoop);
@ -386,7 +386,7 @@ namespace NewHorizons
if (isSolarSystem)
{
foreach (var supernovaPlanetEffectController in GameObject.FindObjectsOfType<SupernovaPlanetEffectController>())
foreach (var supernovaPlanetEffectController in FindObjectsOfType<SupernovaPlanetEffectController>())
{
SupernovaEffectBuilder.ReplaceVanillaWithNH(supernovaPlanetEffectController);
}
@ -417,7 +417,7 @@ namespace NewHorizons
IsWarpingFromVessel = false;
DidWarpFromVessel = shouldWarpInFromVessel;
var map = GameObject.FindObjectOfType<MapController>();
var map = FindObjectOfType<MapController>();
if (map != null) map._maxPanDistance = FurthestOrbit * 1.5f;
// Fix the map satellite
@ -499,7 +499,7 @@ namespace NewHorizons
var ssrLight = solarSystemRoot.AddComponent<Light>();
ssrLight.innerSpotAngle = 0;
ssrLight.spotAngle = 179;
ssrLight.range = Main.FurthestOrbit * (4f / 3f);
ssrLight.range = FurthestOrbit * (4f / 3f);
ssrLight.intensity = 0.001f;
var fluid = playerBody.FindChild("PlayerDetector").GetComponent<DynamicFluidDetector>();

View File

@ -80,13 +80,13 @@ namespace NewHorizons.Utility.DebugTools
var normText = Vector3ToString(data.norm);
var rotText = Vector3ToString(data.rot.eulerAngles);
if (_surfaceSphere != null) GameObject.Destroy(_surfaceSphere);
if (_normalSphere1 != null) GameObject.Destroy(_normalSphere1);
if (_normalSphere2 != null) GameObject.Destroy(_normalSphere2);
if (_planeUpRightSphere != null) GameObject.Destroy(_planeUpRightSphere);
if (_planeUpLeftSphere != null) GameObject.Destroy(_planeUpLeftSphere);
if (_planeDownLeftSphere != null) GameObject.Destroy(_planeDownLeftSphere);
if (_planeDownRightSphere != null) GameObject.Destroy(_planeDownRightSphere);
if (_surfaceSphere != null) Destroy(_surfaceSphere);
if (_normalSphere1 != null) Destroy(_normalSphere1);
if (_normalSphere2 != null) Destroy(_normalSphere2);
if (_planeUpRightSphere != null) Destroy(_planeUpRightSphere);
if (_planeUpLeftSphere != null) Destroy(_planeUpLeftSphere);
if (_planeDownLeftSphere != null) Destroy(_planeDownLeftSphere);
if (_planeDownRightSphere != null) Destroy(_planeDownRightSphere);
_surfaceSphere = AddDebugShape.AddSphere(data.hitBodyGameObject, 0.1f, Color.green);
_normalSphere1 = AddDebugShape.AddSphere(data.hitBodyGameObject, 0.01f, Color.red);

View File

@ -250,7 +250,7 @@ namespace NewHorizons.Utility
bool xCorrect = nomaiCoordinateInterface._nodeControllers[0].CheckCoordinate(coordinates.x);
bool yCorrect = nomaiCoordinateInterface._nodeControllers[1].CheckCoordinate(coordinates.y);
bool zCorrect = nomaiCoordinateInterface._nodeControllers[2].CheckCoordinate(coordinates.z);
OWML.NHLogger.LogVerbose($"Coordinate Check for {system}: {xCorrect}, {yCorrect}, {zCorrect} [{string.Join("-", coordinates.x)}, {string.Join("-", coordinates.y)}, {string.Join("-", coordinates.z)}]");
NHLogger.LogVerbose($"Coordinate Check for {system}: {xCorrect}, {yCorrect}, {zCorrect} [{string.Join("-", coordinates.x)}, {string.Join("-", coordinates.y)}, {string.Join("-", coordinates.z)}]");
return xCorrect && yCorrect && zCorrect;
}

View File

@ -15,7 +15,7 @@ namespace NewHorizons.Utility
}
for (var x = 0; x < count; x++)
{
var randomIndex = UnityEngine.Random.Range(0, numbersInOrder.Count);
var randomIndex = Random.Range(0, numbersInOrder.Count);
result[x] = numbersInOrder[randomIndex];
numbersInOrder.RemoveAt(randomIndex);
}

View File

@ -19,7 +19,7 @@ namespace NewHorizons.Utility
public static List<T> FindObjectsOfTypeAndName<T>(string name) where T : Object
{
T[] firstList = GameObject.FindObjectsOfType<T>();
T[] firstList = Object.FindObjectsOfType<T>();
List<T> finalList = new List<T>();
for (var i = 0; i < firstList.Length; i++)
@ -35,7 +35,7 @@ namespace NewHorizons.Utility
public static T FindObjectOfTypeAndName<T>(string name) where T : Object
{
T[] firstList = GameObject.FindObjectsOfType<T>();
T[] firstList = Object.FindObjectsOfType<T>();
for (var i = 0; i < firstList.Length; i++)
{