mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add ProxyShadowCaster when ProxyShadowCasterSuperGroup exists
This commit is contained in:
parent
9e3fb210c7
commit
3055d0f2c9
@ -1,4 +1,4 @@
|
||||
using NewHorizons.Builder.Body.Geometry;
|
||||
using NewHorizons.Builder.Body.Geometry;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using UnityEngine;
|
||||
@ -16,6 +16,7 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
|
||||
GameObject icosphere = new GameObject("Icosphere");
|
||||
icosphere.SetActive(false);
|
||||
icosphere.transform.parent = sector?.transform ?? planetGO.transform;
|
||||
icosphere.transform.rotation = Quaternion.Euler(90, 0, 0);
|
||||
icosphere.transform.position = planetGO.transform.position;
|
||||
@ -33,7 +34,10 @@ namespace NewHorizons.Builder.Body
|
||||
cubeSphereMC.sharedMesh = mesh;
|
||||
icosphere.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(90, 0, 0));
|
||||
|
||||
icosphere.AddComponent<ProxyShadowCaster>();
|
||||
var superGroup = planetGO.GetComponent<ProxyShadowCasterSuperGroup>();
|
||||
if (superGroup != null) icosphere.AddComponent<ProxyShadowCaster>()._superGroup = superGroup;
|
||||
|
||||
icosphere.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user