mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Use layer util
This commit is contained in:
parent
7a2d3cc893
commit
851b4608c2
@ -1,4 +1,5 @@
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
@ -8,7 +9,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
var airGO = new GameObject("Air");
|
||||
airGO.SetActive(false);
|
||||
airGO.layer = 17;
|
||||
airGO.layer = LayerUtilities.BasicEffectVolume;
|
||||
airGO.transform.parent = sector?.transform ?? planetGO.transform;
|
||||
|
||||
var sc = airGO.AddComponent<SphereCollider>();
|
||||
|
||||
@ -7,6 +7,7 @@ using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using System.Collections.Generic;
|
||||
using Tessellation;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
@ -118,7 +119,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
|
||||
GameObject cloudsFluidGO = new GameObject("CloudsFluid");
|
||||
cloudsFluidGO.SetActive(false);
|
||||
cloudsFluidGO.layer = 17;
|
||||
cloudsFluidGO.layer = LayerUtilities.BasicEffectVolume;
|
||||
cloudsFluidGO.transform.parent = cloudsMainGO.transform;
|
||||
|
||||
SphereCollider fluidSC = cloudsFluidGO.AddComponent<SphereCollider>();
|
||||
@ -251,7 +252,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
|
||||
if (atmo.clouds.unlit)
|
||||
{
|
||||
cloudsTopGO.layer = LayerMask.NameToLayer("IgnoreSun");
|
||||
cloudsTopGO.layer = LayerUtilities.IgnoreSun;
|
||||
}
|
||||
|
||||
if (atmo.clouds.rotationSpeed != 0f)
|
||||
@ -303,7 +304,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
GameObject tcrqcGO = new GameObject("TransparentCloudRenderQueueController");
|
||||
tcrqcGO.transform.SetParent(cloudsTransparentGO.transform, false);
|
||||
tcrqcGO.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
tcrqcGO.layer = LayerUtilities.BasicEffectVolume;
|
||||
|
||||
var shape = tcrqcGO.AddComponent<SphereShape>();
|
||||
shape.radius = 1;
|
||||
|
||||
@ -8,6 +8,7 @@ using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.Components.Volumes;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
@ -30,7 +31,7 @@ namespace NewHorizons.Builder.Body
|
||||
ringVolume.transform.localPosition = Vector3.zero;
|
||||
ringVolume.transform.localScale = Vector3.one;
|
||||
ringVolume.transform.localRotation = Quaternion.identity;
|
||||
ringVolume.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
ringVolume.layer = LayerUtilities.BasicEffectVolume;
|
||||
|
||||
var ringShape = ringVolume.AddComponent<RingShape>();
|
||||
ringShape.innerRadius = ring.innerRadius;
|
||||
|
||||
@ -11,6 +11,7 @@ using System.Drawing;
|
||||
using Color = UnityEngine.Color;
|
||||
using NewHorizons.Components.Volumes;
|
||||
using NewHorizons.Utility.OWMLUtilities;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
@ -191,7 +192,7 @@ namespace NewHorizons.Builder.Body
|
||||
if (hasDestructionVolume || targetStarSystem != null)
|
||||
{
|
||||
var destructionVolumeGO = new GameObject("DestructionVolume");
|
||||
destructionVolumeGO.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
destructionVolumeGO.layer = LayerUtilities.BasicEffectVolume;
|
||||
destructionVolumeGO.transform.parent = singularity.transform;
|
||||
destructionVolumeGO.transform.localScale = Vector3.one;
|
||||
destructionVolumeGO.transform.localPosition = Vector3.zero;
|
||||
|
||||
@ -9,6 +9,7 @@ using OWML.Common;
|
||||
using UnityEngine.InputSystem.XR;
|
||||
using System.Linq;
|
||||
using NewHorizons.Components.Stars;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
@ -122,7 +123,7 @@ namespace NewHorizons.Builder.Body
|
||||
heatVolume.transform.SetParent(starGO.transform, false);
|
||||
heatVolume.transform.localPosition = Vector3.zero;
|
||||
heatVolume.transform.localScale = Vector3.one;
|
||||
heatVolume.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
heatVolume.layer = LayerUtilities.BasicEffectVolume;
|
||||
heatVolume.AddComponent<SphereShape>().radius = 1.1f;
|
||||
heatVolume.AddComponent<OWTriggerVolume>();
|
||||
heatVolume.AddComponent<HeatHazardVolume>()._damagePerSecond = 20f;
|
||||
@ -132,7 +133,7 @@ namespace NewHorizons.Builder.Body
|
||||
deathVolume.transform.SetParent(starGO.transform, false);
|
||||
deathVolume.transform.localPosition = Vector3.zero;
|
||||
deathVolume.transform.localScale = Vector3.one;
|
||||
deathVolume.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
deathVolume.layer = LayerUtilities.BasicEffectVolume;
|
||||
var sphereCollider = deathVolume.AddComponent<SphereCollider>();
|
||||
sphereCollider.radius = 1f;
|
||||
sphereCollider.isTrigger = true;
|
||||
@ -148,7 +149,7 @@ namespace NewHorizons.Builder.Body
|
||||
planetDestructionVolume.transform.SetParent(starGO.transform, false);
|
||||
planetDestructionVolume.transform.localPosition = Vector3.zero;
|
||||
planetDestructionVolume.transform.localScale = Vector3.one;
|
||||
planetDestructionVolume.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
planetDestructionVolume.layer = LayerUtilities.BasicEffectVolume;
|
||||
var planetSphereCollider = planetDestructionVolume.AddComponent<SphereCollider>();
|
||||
planetSphereCollider.radius = 0.8f;
|
||||
planetSphereCollider.isTrigger = true;
|
||||
@ -445,7 +446,7 @@ namespace NewHorizons.Builder.Body
|
||||
supernovaWallAudio.transform.SetParent(supernovaGO.transform, false);
|
||||
supernovaWallAudio.transform.localPosition = Vector3.zero;
|
||||
supernovaWallAudio.transform.localScale = Vector3.one;
|
||||
supernovaWallAudio.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
supernovaWallAudio.layer = LayerUtilities.BasicEffectVolume;
|
||||
var audioSource = supernovaWallAudio.AddComponent<AudioSource>();
|
||||
audioSource.loop = true;
|
||||
audioSource.maxDistance = 2000;
|
||||
|
||||
@ -4,6 +4,7 @@ using UnityEngine;
|
||||
using NewHorizons.External.Modules.VariableSize;
|
||||
using Tessellation;
|
||||
using NewHorizons.Utility.OWMLUtilities;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
@ -53,7 +54,7 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
// Don't ignore sun when not under clouds
|
||||
waterGO.layer = 0;
|
||||
Delay.FireOnNextUpdate(() => { if (planetGO.FindChild("Sector/SunOverride") != null) waterGO.layer = 15; });
|
||||
Delay.FireOnNextUpdate(() => { if (planetGO.FindChild("Sector/SunOverride") != null) waterGO.layer = LayerUtilities.IgnoreSun; });
|
||||
|
||||
TessellatedSphereRenderer TSR = waterGO.AddComponent<TessellatedSphereRenderer>();
|
||||
TSR.tessellationMeshGroup = ScriptableObject.CreateInstance<MeshGroup>();
|
||||
@ -100,7 +101,7 @@ namespace NewHorizons.Builder.Body
|
||||
var buoyancyObject = new GameObject("WaterVolume");
|
||||
buoyancyObject.transform.parent = waterGO.transform;
|
||||
buoyancyObject.transform.localScale = Vector3.one;
|
||||
buoyancyObject.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
buoyancyObject.layer = LayerUtilities.BasicEffectVolume;
|
||||
|
||||
var sphereCollider = buoyancyObject.AddComponent<SphereCollider>();
|
||||
sphereCollider.radius = 1;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using NewHorizons.Components.Orbital;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
@ -81,7 +82,7 @@ namespace NewHorizons.Builder.General
|
||||
detectorGO.SetActive(false);
|
||||
detectorGO.transform.parent = planetGO.transform;
|
||||
detectorGO.transform.localPosition = Vector3.zero;
|
||||
detectorGO.layer = LayerMask.NameToLayer("BasicDetector");
|
||||
detectorGO.layer = LayerUtilities.BasicDetector;
|
||||
|
||||
ConstantForceDetector forceDetector = detectorGO.AddComponent<ConstantForceDetector>();
|
||||
forceDetector._inheritElement0 = true;
|
||||
@ -90,7 +91,7 @@ namespace NewHorizons.Builder.General
|
||||
// For falling into sun
|
||||
if (!config.Base.invulnerableToSun && config.Star == null && config.FocalPoint == null)
|
||||
{
|
||||
detectorGO.layer = LayerMask.NameToLayer("AdvancedDetector");
|
||||
detectorGO.layer = LayerUtilities.AdvancedDetector;
|
||||
|
||||
var fluidDetector = detectorGO.AddComponent<DynamicFluidDetector>();
|
||||
var sphereCollider = detectorGO.AddComponent<SphereCollider>();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
namespace NewHorizons.Builder.General
|
||||
@ -23,7 +24,7 @@ namespace NewHorizons.Builder.General
|
||||
var gravityGO = new GameObject("GravityWell");
|
||||
gravityGO.transform.parent = planetGO.transform;
|
||||
gravityGO.transform.localPosition = Vector3.zero;
|
||||
gravityGO.layer = 17;
|
||||
gravityGO.layer = LayerUtilities.BasicEffectVolume;
|
||||
gravityGO.SetActive(false);
|
||||
|
||||
var SC = gravityGO.AddComponent<SphereCollider>();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Builder.General
|
||||
{
|
||||
@ -12,7 +13,7 @@ namespace NewHorizons.Builder.General
|
||||
var rfGO = new GameObject("RFVolume");
|
||||
rfGO.transform.parent = planetGO.transform;
|
||||
rfGO.transform.localPosition = Vector3.zero;
|
||||
rfGO.layer = 19;
|
||||
rfGO.layer = LayerUtilities.ReferenceFrameVolume;
|
||||
rfGO.SetActive(false);
|
||||
|
||||
var SC = rfGO.AddComponent<SphereCollider>();
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OWMLUtilities;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
@ -17,7 +18,7 @@ namespace NewHorizons.Builder.General
|
||||
{
|
||||
GameObject spawnGO = new GameObject("PlayerSpawnPoint");
|
||||
spawnGO.transform.parent = planetGO.transform;
|
||||
spawnGO.layer = 8;
|
||||
spawnGO.layer = LayerUtilities.PlayerSafetyCollider;
|
||||
|
||||
spawnGO.transform.localPosition = module.playerSpawnPoint;
|
||||
|
||||
@ -39,7 +40,7 @@ namespace NewHorizons.Builder.General
|
||||
{
|
||||
GameObject spawnGO = new GameObject("ShipSpawnPoint");
|
||||
spawnGO.transform.parent = planetGO.transform;
|
||||
spawnGO.layer = 8;
|
||||
spawnGO.layer = LayerUtilities.PlayerSafetyCollider;
|
||||
|
||||
spawnGO.transform.localPosition = module.shipSpawnPoint;
|
||||
|
||||
@ -70,7 +71,7 @@ namespace NewHorizons.Builder.General
|
||||
Logger.LogVerbose("Overriding player spawn to be inside ship");
|
||||
GameObject playerSpawnGO = new GameObject("PlayerSpawnPoint");
|
||||
playerSpawnGO.transform.parent = ship.transform;
|
||||
playerSpawnGO.layer = 8;
|
||||
playerSpawnGO.layer = LayerUtilities.PlayerSafetyCollider;
|
||||
|
||||
playerSpawnGO.transform.localPosition = new Vector3(0, 0, 0);
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ using UnityEngine;
|
||||
using NewHorizons.Utility;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
@ -103,7 +104,7 @@ namespace NewHorizons.Builder.Props
|
||||
var conversationZone = new GameObject("ConversationZone");
|
||||
conversationZone.SetActive(false);
|
||||
|
||||
conversationZone.layer = LayerMask.NameToLayer("Interactible");
|
||||
conversationZone.layer = LayerUtilities.Interactible;
|
||||
|
||||
var sphere = conversationZone.AddComponent<SphereCollider>();
|
||||
sphere.radius = info.radius;
|
||||
@ -259,7 +260,7 @@ namespace NewHorizons.Builder.Props
|
||||
var playerTrackingZone = new GameObject("PlayerTrackingZone");
|
||||
playerTrackingZone.SetActive(false);
|
||||
|
||||
playerTrackingZone.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
playerTrackingZone.layer = LayerUtilities.BasicEffectVolume;
|
||||
playerTrackingZone.SetActive(false);
|
||||
|
||||
var sphereCollider = playerTrackingZone.AddComponent<SphereCollider>();
|
||||
|
||||
@ -2,7 +2,7 @@ using HarmonyLib;
|
||||
using NewHorizons.Components.Quantum;
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility.UnityUtilities;
|
||||
using NewHorizons.Utility.Geometry;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Linq;
|
||||
@ -86,7 +87,7 @@ namespace NewHorizons.Builder.Props
|
||||
if (_shareStonePrefab == null)
|
||||
{
|
||||
GameObject stone = new GameObject("ShareStoneFallback");
|
||||
stone.layer = LayerMask.NameToLayer("Interactible");
|
||||
stone.layer = LayerUtilities.Interactible;
|
||||
stone.SetActive(false);
|
||||
SphereCollider sc = stone.AddComponent<SphereCollider>();
|
||||
sc.center = Vector3.zero;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OWMLUtilities;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using OWML.Common;
|
||||
using OWML.Utils;
|
||||
using System.Collections.Generic;
|
||||
@ -130,7 +131,7 @@ namespace NewHorizons.Builder.Props
|
||||
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||
if (info.isRelativeToParent) signalGO.transform.localPosition = pos;
|
||||
else signalGO.transform.position = planetGO.transform.TransformPoint(pos);
|
||||
signalGO.layer = LayerMask.NameToLayer("AdvancedEffectVolume");
|
||||
signalGO.layer = LayerUtilities.AdvancedEffectVolume;
|
||||
|
||||
var source = signalGO.AddComponent<AudioSource>();
|
||||
var owAudioSource = signalGO.AddComponent<OWAudioSource>();
|
||||
|
||||
@ -1,14 +1,13 @@
|
||||
using NewHorizons.Utility.UnityUtilities;
|
||||
using System.Collections;
|
||||
using NewHorizons.Utility.Geometry;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Profiling;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
public class NomaiTextArcArranger : MonoBehaviour {
|
||||
public class NomaiTextArcArranger : MonoBehaviour
|
||||
{
|
||||
private static int MAX_MOVE_DISTANCE = 2;
|
||||
|
||||
public List<SpiralManipulator> spirals = new List<SpiralManipulator>();
|
||||
@ -118,7 +117,8 @@ namespace NewHorizons.Builder.Props
|
||||
point = spiral.parent.transform.TransformPoint(point);
|
||||
|
||||
var dist = Vector2.Distance(point, idealPoint);
|
||||
if (dist < bestPointDistance) {
|
||||
if (dist < bestPointDistance)
|
||||
{
|
||||
bestPointDistance = dist;
|
||||
bestPointIndex = j;
|
||||
}
|
||||
@ -251,7 +251,8 @@ namespace NewHorizons.Builder.Props
|
||||
.Select(p => spiral.transform.parent.InverseTransformPoint(p))
|
||||
.ToList();
|
||||
|
||||
foreach(var point in points) {
|
||||
foreach (var point in points)
|
||||
{
|
||||
if (point.x < minX || point.x > maxX ||
|
||||
point.y < minY || point.y > maxY)
|
||||
{
|
||||
@ -296,7 +297,8 @@ namespace NewHorizons.Builder.Props
|
||||
#endregion bounds handling
|
||||
}
|
||||
|
||||
public class SpiralManipulator : MonoBehaviour {
|
||||
public class SpiralManipulator : MonoBehaviour
|
||||
{
|
||||
public SpiralManipulator parent;
|
||||
public List<SpiralManipulator> children = new List<SpiralManipulator>();
|
||||
|
||||
@ -336,7 +338,8 @@ namespace NewHorizons.Builder.Props
|
||||
|
||||
#endregion properties
|
||||
|
||||
public SpiralManipulator AddChild(NomaiTextArcBuilder.SpiralProfile profile) {
|
||||
public SpiralManipulator AddChild(NomaiTextArcBuilder.SpiralProfile profile)
|
||||
{
|
||||
var child = NomaiTextArcArranger.CreateSpiral(profile, this.transform.parent.gameObject);
|
||||
|
||||
var index = Random.Range(MIN_PARENT_POINT, MAX_PARENT_POINT);
|
||||
|
||||
@ -1,20 +1,18 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility;
|
||||
using OWML.Common;
|
||||
using NewHorizons.Utility.Geometry;
|
||||
using NewHorizons.Utility.OWMLUtilities;
|
||||
using Newtonsoft.Json;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using UnityEngine;
|
||||
using Enum = System.Enum;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
using Random = UnityEngine.Random;
|
||||
using OWML.Utils;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using NewHorizons.Utility.OWMLUtilities;
|
||||
using NewHorizons.Utility.UnityUtilities;
|
||||
|
||||
namespace NewHorizons.Builder.Props
|
||||
{
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using NewHorizons.Components.Achievement;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using OWML.Common;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
@ -122,7 +123,7 @@ namespace NewHorizons.Builder.ShipLog
|
||||
|
||||
private static void MakeObservable(GameObject go, Sector sector, VolumesModule.RevealVolumeInfo info, IModBehaviour mod)
|
||||
{
|
||||
go.layer = LayerMask.NameToLayer("Interactible");
|
||||
go.layer = LayerUtilities.Interactible;
|
||||
|
||||
var sphere = go.AddComponent<SphereCollider>();
|
||||
sphere.radius = info.radius;
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
using NewHorizons.External.Configs;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OWMLUtilities;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
namespace NewHorizons.Builder.StarSystem
|
||||
{
|
||||
public static class SkyboxBuilder
|
||||
{
|
||||
private static readonly int _skyboxLayer = LayerMask.NameToLayer("Skybox");
|
||||
private static readonly Shader _unlitShader = Shader.Find("Unlit/Texture");
|
||||
|
||||
public static void Make(StarSystemConfig.SkyboxModule module, IModBehaviour mod)
|
||||
@ -33,7 +33,7 @@ namespace NewHorizons.Builder.StarSystem
|
||||
|
||||
var skySphere = new GameObject("Sky Sphere");
|
||||
skySphere.transform.SetParent(skybox.transform, false);
|
||||
skySphere.layer = _skyboxLayer;
|
||||
skySphere.layer = LayerUtilities.Skybox;
|
||||
skySphere.transform.localScale = Vector3.one * 5f;
|
||||
|
||||
BuildSkySphereFace(skySphere, "Right", Quaternion.Euler(0f, 90f, 0f), mesh, rightTex);
|
||||
@ -56,7 +56,7 @@ namespace NewHorizons.Builder.StarSystem
|
||||
|
||||
var go = new GameObject(name)
|
||||
{
|
||||
layer = _skyboxLayer
|
||||
layer = LayerUtilities.Skybox
|
||||
};
|
||||
|
||||
var mf = go.AddComponent<MeshFilter>();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using OWML.Common;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
@ -42,7 +43,7 @@ namespace NewHorizons.Builder.Volumes
|
||||
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||
if (info.isRelativeToParent) go.transform.localPosition = pos;
|
||||
else go.transform.position = planetGO.transform.TransformPoint(pos);
|
||||
go.layer = LayerMask.NameToLayer("AdvancedEffectVolume");
|
||||
go.layer = LayerUtilities.AdvancedEffectVolume;
|
||||
|
||||
var audioSource = go.AddComponent<AudioSource>();
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using OWML.Common;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
@ -39,7 +40,7 @@ namespace NewHorizons.Builder.Volumes
|
||||
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||
if (info.isRelativeToParent) go.transform.localPosition = pos;
|
||||
else go.transform.position = planetGO.transform.TransformPoint(pos);
|
||||
go.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
go.layer = LayerUtilities.BasicEffectVolume;
|
||||
|
||||
var shape = go.AddComponent<SphereShape>();
|
||||
shape.radius = info.radius;
|
||||
@ -74,7 +75,7 @@ namespace NewHorizons.Builder.Volumes
|
||||
var detectorGO = new GameObject("ConstantFluidDetector");
|
||||
detectorGO.transform.parent = go.transform;
|
||||
detectorGO.transform.localPosition = Vector3.zero;
|
||||
detectorGO.layer = LayerMask.NameToLayer("BasicDetector");
|
||||
detectorGO.layer = LayerUtilities.BasicDetector;
|
||||
var detector = detectorGO.AddComponent<ConstantFluidDetector>();
|
||||
detector._onlyDetectableFluid = water;
|
||||
detector._buoyancy.boundingRadius = 1;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -42,7 +43,7 @@ namespace NewHorizons.Builder.Volumes
|
||||
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||
if (info.isRelativeToParent) go.transform.localPosition = pos;
|
||||
else go.transform.position = planetGO.transform.TransformPoint(pos);
|
||||
go.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
go.layer = LayerUtilities.BasicEffectVolume;
|
||||
|
||||
var shape = go.AddComponent<SphereShape>();
|
||||
shape.radius = info.radius;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
@ -35,7 +36,7 @@ namespace NewHorizons.Builder.Volumes
|
||||
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||
if (info.isRelativeToParent) go.transform.localPosition = pos;
|
||||
else go.transform.position = planetGO.transform.TransformPoint(pos);
|
||||
go.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
go.layer = LayerUtilities.BasicEffectVolume;
|
||||
|
||||
var collider = go.AddComponent<SphereCollider>();
|
||||
collider.isTrigger = true;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using NewHorizons.Components;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
|
||||
@ -35,7 +36,7 @@ namespace NewHorizons.Builder.Volumes
|
||||
var pos = (Vector3)(info.position ?? Vector3.zero);
|
||||
if (info.isRelativeToParent) go.transform.localPosition = pos;
|
||||
else go.transform.position = planetGO.transform.TransformPoint(pos);
|
||||
go.layer = LayerMask.NameToLayer("BasicEffectVolume");
|
||||
go.layer = LayerUtilities.BasicEffectVolume;
|
||||
|
||||
var shape = go.AddComponent<SphereShape>();
|
||||
shape.radius = info.radius;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using NewHorizons.OtherMods.AchievementsPlus;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -20,7 +21,7 @@ namespace NewHorizons.Components.Achievement
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
gameObject.layer = LayerMask.NameToLayer("Interactible");
|
||||
gameObject.layer = LayerUtilities.Interactible;
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components;
|
||||
@ -38,7 +39,7 @@ public class AddPhysics : MonoBehaviour
|
||||
var owRigidbody = bodyGo.AddComponent<OWRigidbody>();
|
||||
owRigidbody._simulateInSector = Sector;
|
||||
|
||||
bodyGo.layer = LayerMask.NameToLayer("PhysicalDetector");
|
||||
bodyGo.layer = LayerUtilities.PhysicalDetector;
|
||||
bodyGo.tag = "DynamicPropDetector";
|
||||
// this collider is not included in groups. oh well
|
||||
bodyGo.AddComponent<SphereCollider>().radius = Radius;
|
||||
|
||||
@ -16,6 +16,8 @@ using NewHorizons.OtherMods.VoiceActing;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.DebugMenu;
|
||||
using NewHorizons.Utility.DebugUtilities;
|
||||
using NewHorizons.Utility.OWMLUtilities;
|
||||
using NewHorizons.Utility.OWUtilities;
|
||||
using OWML.Common;
|
||||
using OWML.ModHelper;
|
||||
using OWML.Utils;
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
using NewHorizons.Builder.Props;
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.Handlers;
|
||||
using NewHorizons.Utility.UnityUtilities;
|
||||
using NewHorizons.Utility.Geometry;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using UnityEngine;
|
||||
namespace NewHorizons.Utility.UnityUtilities
|
||||
namespace NewHorizons.Utility.Geometry
|
||||
{
|
||||
public static class AddDebugShape
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user