fix for groundsize reliance

This commit is contained in:
Mister_Nebula 2020-06-30 21:37:27 +01:00
parent dee2dd1016
commit 9e0ed34e81
8 changed files with 36 additions and 33 deletions

View File

@ -14,7 +14,7 @@ namespace Marshmallow.External
int OrbitAngle { get; }
string PrimaryBody { get; }
bool IsMoon { get; }
//bool HasSpawnPoint { get; }
float AtmoEndSize { get; }
bool HasClouds { get; }
float TopCloudSize { get; }
float BottomCloudSize { get; }
@ -29,6 +29,7 @@ namespace Marshmallow.External
bool HasFog { get; }
MColor32 FogTint { get; }
float FogDensity { get; }
bool HasGround { get; }
float GroundSize { get; }
bool IsTidallyLocked { get; }
MColor32 LightTint { get; }

View File

@ -16,7 +16,7 @@ namespace Marshmallow.External
public int OrbitAngle { get; set; }
public string PrimaryBody { get; set; }
public bool IsMoon { get; set; }
//public bool HasSpawnPoint { get; set; }
public float AtmoEndSize { get; set; }
public bool HasClouds { get; set; }
public float TopCloudSize { get; set; }
public float BottomCloudSize { get; set; }
@ -31,6 +31,7 @@ namespace Marshmallow.External
public bool HasFog { get; set; }
public MColor32 FogTint { get; set; }
public float FogDensity { get; set; }
public bool HasGround { get; set; }
public float GroundSize { get; set; }
public bool IsTidallyLocked { get; set; }
public MColor32 LightTint { get; set; }

View File

@ -14,7 +14,7 @@ namespace Marshmallow.General
Light L = lightGO.AddComponent<Light>();
L.type = LightType.Point;
L.range = config.GroundSize * 2;
L.range = config.AtmoEndSize + 10;
L.color = config.LightTint.ToColor32();
L.intensity = 0.8f;
L.shadows = LightShadows.None;

View File

@ -16,7 +16,7 @@ namespace Marshmallow.General
SphereCollider SC = rfGO.AddComponent<SphereCollider>();
SC.isTrigger = true;
SC.radius = config.GroundSize * 4;
SC.radius = config.AtmoEndSize * 2;
ReferenceFrameVolume RFV = rfGO.AddComponent<ReferenceFrameVolume>();
@ -33,7 +33,7 @@ namespace Marshmallow.General
RFV.SetValue("_referenceFrame", RV);
RFV.SetValue("_minColliderRadius", 300);
RFV.SetValue("_maxColliderRadius", config.GroundSize * 4);
RFV.SetValue("_maxColliderRadius", config.AtmoEndSize * 2);
RFV.SetValue("_isPrimaryVolume", true);
RFV.SetValue("_isCloseRangeVolume", false);

View File

@ -19,7 +19,7 @@ namespace Marshmallow.Body
SS.SetLayer(Shape.Layer.Sector);
SS.layerMask = -1;
SS.pointChecksOnly = true;
SS.radius = config.GroundSize * 2;
SS.radius = config.AtmoEndSize + 10;
SS.center = Vector3.zero;
/*OWTriggerVolume trigVol = */sectorGO.AddComponent<OWTriggerVolume>();

View File

@ -21,18 +21,16 @@ namespace Marshmallow
public static List<MarshmallowBody> bodyList = new List<MarshmallowBody>();
bool finishNext = false;
private bool finishNextUpdate = false;
//public override object GetApi()
//{
// return new MarshmallowApi();
//}
public override object GetApi()
{
return new MarshmallowApi();
}
void Start()
{
SceneManager.sceneLoaded += OnSceneLoaded;
helper = base.ModHelper;
Logger.Log("Begin load of config files...", Logger.LogType.Log);
@ -75,20 +73,20 @@ namespace Marshmallow
planetObject.SetActive(true);
body.Object = planetObject;
finishNext = true;
}
finishNextUpdate = true;
}
void Update()
{
if (finishNext)
if (finishNextUpdate)
{
foreach (var body in bodyList)
{
OrbitlineBuilder.Make(body.Object, body.Object.GetComponent<AstroObject>());
}
finishNext = false;
finishNextUpdate = false;
}
}
@ -167,19 +165,20 @@ namespace Marshmallow
{
public void Create(Dictionary<string, object> config)
{
Logger.Log("Recieved API request to create planet " + (string)config["Name"] + " at position " + (Vector3)config["Position"], Logger.LogType.Log);
var planetConfig = new PlanetConfig
{
Name = (string)config["Name"],
Position = (MVector3)config["Position"],
Position = new MVector3(((Vector3)config["Position"]).x, ((Vector3)config["Position"]).y, ((Vector3)config["Position"]).z),
OrbitAngle = (int)config["OrbitAngle"],
IsMoon = (bool)config["IsMoon"],
AtmoEndSize = (float)config["AtmoEndSize"],
PrimaryBody = (string)config["PrimaryBody"],
//HasSpawnPoint = (bool)config["HasSpawnPoint"],
HasClouds = (bool)config["HasClouds"],
TopCloudSize = (float)config["TopCloudSize"],
BottomCloudSize = (float)config["BottomCloudSize"],
TopCloudTint = (MColor32)config["TopCloudTint"],
BottomCloudTint = (MColor32)config["BottomCloudTint"],
TopCloudTint = new MColor32(((Color32)config["TopCloudTint"]).r, ((Color32)config["TopCloudTint"]).g, ((Color32)config["TopCloudTint"]).b, ((Color32)config["TopCloudTint"]).a),
BottomCloudTint = new MColor32(((Color32)config["BottomCloudTint"]).r, ((Color32)config["BottomCloudTint"]).g, ((Color32)config["BottomCloudTint"]).b, ((Color32)config["BottomCloudTint"]).a),
HasWater = (bool)config["HasWater"],
WaterSize = (float)config["WaterSize"],
HasRain = (bool)config["HasRain"],
@ -187,10 +186,12 @@ namespace Marshmallow
SurfaceAcceleration = (float)config["SurfaceAcceleration"],
HasMapMarker = (bool)config["HasMapMarker"],
HasFog = (bool)config["HasFog"],
FogTint = (MColor32)config["FogTint"],
FogTint = new MColor32(((Color32)config["FogTint"]).r, ((Color32)config["FogTint"]).g, ((Color32)config["FogTint"]).b, ((Color32)config["FogTint"]).a),
FogDensity = (float)config["FogDensity"],
GroundSize = (float)config["GroundScale"],
IsTidallyLocked = (bool)config["IsTidallyLocked"]
HasGround = (bool)config["HasGround"],
GroundSize = (float)config["GroundSize"],
IsTidallyLocked = (bool)config["IsTidallyLocked"],
LightTint = new MColor32(((Color32)config["LightTint"]).r, ((Color32)config["LightTint"]).g, ((Color32)config["LightTint"]).b, ((Color32)config["LightTint"]).a),
};
Main.CreateBody(planetConfig);

View File

@ -36,31 +36,31 @@
<HintPath>E:\Steam\steamapps\common\Outer Wilds\OuterWilds_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="NAudio-Unity, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\OWML.0.3.53\lib\net35\NAudio-Unity.dll</HintPath>
<HintPath>..\packages\OWML.0.3.55\lib\net35\NAudio-Unity.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net35\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="OWML, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\OWML.0.3.53\lib\net35\OWML.dll</HintPath>
<HintPath>..\packages\OWML.0.3.55\lib\net35\OWML.dll</HintPath>
</Reference>
<Reference Include="OWML.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\OWML.0.3.53\lib\net35\OWML.Common.dll</HintPath>
<HintPath>..\packages\OWML.0.3.55\lib\net35\OWML.Common.dll</HintPath>
</Reference>
<Reference Include="OWML.ModHelper, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\OWML.0.3.53\lib\net35\OWML.ModHelper.dll</HintPath>
<HintPath>..\packages\OWML.0.3.55\lib\net35\OWML.ModHelper.dll</HintPath>
</Reference>
<Reference Include="OWML.ModHelper.Assets, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\OWML.0.3.53\lib\net35\OWML.ModHelper.Assets.dll</HintPath>
<HintPath>..\packages\OWML.0.3.55\lib\net35\OWML.ModHelper.Assets.dll</HintPath>
</Reference>
<Reference Include="OWML.ModHelper.Events, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\OWML.0.3.53\lib\net35\OWML.ModHelper.Events.dll</HintPath>
<HintPath>..\packages\OWML.0.3.55\lib\net35\OWML.ModHelper.Events.dll</HintPath>
</Reference>
<Reference Include="OWML.ModHelper.Interaction, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\OWML.0.3.53\lib\net35\OWML.ModHelper.Interaction.dll</HintPath>
<HintPath>..\packages\OWML.0.3.55\lib\net35\OWML.ModHelper.Interaction.dll</HintPath>
</Reference>
<Reference Include="OWML.ModHelper.Menus, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\OWML.0.3.53\lib\net35\OWML.ModHelper.Menus.dll</HintPath>
<HintPath>..\packages\OWML.0.3.55\lib\net35\OWML.ModHelper.Menus.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@ -3,5 +3,5 @@
<package id="Json.Net.Unity3D" version="9.0.1" targetFramework="net35" />
<package id="Lib.Harmony" version="2.0.0.9" targetFramework="net35" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net35" />
<package id="OWML" version="0.3.53" targetFramework="net35" />
<package id="OWML" version="0.3.55" targetFramework="net35" />
</packages>