Fixed casing on more modules

This commit is contained in:
Ben C 2022-05-23 18:39:19 -04:00
parent 031e8b99bb
commit 22f96ddea3
22 changed files with 153 additions and 149 deletions

View File

@ -117,7 +117,7 @@ namespace NewHorizons.Builder.Atmosphere
for(int i = 0; i < atmo.clouds.lightningGradient.Length; i++)
{
var pair = atmo.clouds.lightningGradient[i];
gradient[i] = new GradientColorKey(pair.Tint, pair.Time);
gradient[i] = new GradientColorKey(pair.tint, pair.time);
}
lightningGenerator._lightColor.colorKeys = gradient;

View File

@ -40,13 +40,13 @@ namespace NewHorizons.Builder.Body
config.Orbit = new OrbitModule()
{
IsMoon = true,
isMoon = true,
inclination = belt.inclination + Random.Range(-2f, 2f),
longitudeOfAscendingNode = belt.longitudeOfAscendingNode,
trueAnomaly = 360f * (i + Random.Range(-0.2f, 0.2f)) / (float)count,
PrimaryBody = bodyName,
primaryBody = bodyName,
semiMajorAxis = Random.Range(belt.innerRadius, belt.outerRadius),
ShowOrbitLine = false
showOrbitLine = false
};
config.ProcGen = belt.procGen;

View File

@ -14,7 +14,7 @@ namespace NewHorizons.Builder.General
if (config.Orbit != null) astroObject.SetOrbitalParametersFromConfig(config.Orbit);
var type = AstroObject.Type.Planet;
if (config.Orbit.IsMoon) type = AstroObject.Type.Moon;
if (config.Orbit.isMoon) type = AstroObject.Type.Moon;
// else if (config.Base.IsSatellite) type = AstroObject.Type.Satellite;
else if (config.Base.hasCometTail) type = AstroObject.Type.Comet;
else if (config.Star != null) type = AstroObject.Type.Star;
@ -25,25 +25,25 @@ namespace NewHorizons.Builder.General
astroObject._primaryBody = primaryBody;
// Expand gravitational sphere of influence of the primary to encompass this body if needed
if (primaryBody?.gameObject?.GetComponent<SphereCollider>() != null && !config.Orbit.IsStatic)
if (primaryBody?.gameObject?.GetComponent<SphereCollider>() != null && !config.Orbit.isStatic)
{
var primarySphereOfInfluence = primaryBody.GetGravityVolume().gameObject.GetComponent<SphereCollider>();
if (primarySphereOfInfluence.radius < config.Orbit.semiMajorAxis)
primarySphereOfInfluence.radius = config.Orbit.semiMajorAxis * 1.5f;
}
if (config.Orbit.IsTidallyLocked)
if (config.Orbit.isTidallyLocked)
{
var alignment = body.AddComponent<AlignWithTargetBody>();
alignment.SetTargetBody(primaryBody?.GetAttachedOWRigidbody());
alignment._usePhysicsToRotate = true;
if (config.Orbit.AlignmentAxis == null)
if (config.Orbit.alignmentAxis == null)
{
alignment._localAlignmentAxis = new Vector3(0, -1, 0);
}
else
{
alignment._localAlignmentAxis = config.Orbit.AlignmentAxis;
alignment._localAlignmentAxis = config.Orbit.alignmentAxis;
}
}

View File

@ -1,6 +1,11 @@
using NewHorizons.External.Configs;
#region
using NewHorizons.External.Configs;
using NewHorizons.Handlers;
using UnityEngine;
#endregion
namespace NewHorizons.Builder.General
{
static class MarkerBuilder
@ -12,7 +17,7 @@ namespace NewHorizons.Builder.General
var markerType = MapMarker.MarkerType.Planet;
if (config.Orbit.IsMoon)
if (config.Orbit.isMoon)
{
markerType = MapMarker.MarkerType.Moon;
}

View File

@ -19,11 +19,11 @@ namespace NewHorizons.Builder.Orbital
initialMotion._orbitImpulseScalar = 0f;
// Rotation
initialMotion._initAngularSpeed = orbit.SiderealPeriod == 0 ? 0f : 2f * Mathf.PI / (orbit.SiderealPeriod * 60f);
var rotationAxis = Quaternion.AngleAxis(orbit.AxialTilt, Vector3.right) * Vector3.up;
initialMotion._initAngularSpeed = orbit.siderealPeriod == 0 ? 0f : 2f * Mathf.PI / (orbit.siderealPeriod * 60f);
var rotationAxis = Quaternion.AngleAxis(orbit.axialTilt, Vector3.right) * Vector3.up;
secondaryBody.transform.rotation = Quaternion.FromToRotation(Vector3.up, rotationAxis);
if (!orbit.IsStatic && primaryBody != null)
if (!orbit.isStatic && primaryBody != null)
{
SetInitialMotion(initialMotion, primaryBody, secondaryBody);
}

View File

@ -20,16 +20,16 @@ namespace NewHorizons.Builder.Orbital
var lineRenderer = orbitGO.AddComponent<LineRenderer>();
lineRenderer.material = new Material(config.Orbit.DottedOrbitLine ? _dottedLineMaterial : _lineMaterial);
lineRenderer.textureMode = config.Orbit.DottedOrbitLine ? LineTextureMode.RepeatPerSegment : LineTextureMode.Stretch;
lineRenderer.material = new Material(config.Orbit.dottedOrbitLine ? _dottedLineMaterial : _lineMaterial);
lineRenderer.textureMode = config.Orbit.dottedOrbitLine ? LineTextureMode.RepeatPerSegment : LineTextureMode.Stretch;
var width = config.Orbit.DottedOrbitLine ? 100 : 50;
var width = config.Orbit.dottedOrbitLine ? 100 : 50;
lineRenderer.startWidth = width;
lineRenderer.endWidth = width;
lineRenderer.useWorldSpace = false;
lineRenderer.loop = false;
var numVerts = config.Orbit.DottedOrbitLine ? 128 : 256;
var numVerts = config.Orbit.dottedOrbitLine ? 128 : 256;
lineRenderer.positionCount = numVerts;
var ecc = config.Orbit.eccentricity;
@ -37,7 +37,7 @@ namespace NewHorizons.Builder.Orbital
var parentGravity = astroObject.GetPrimaryBody()?.GetGravityVolume();
OrbitLine orbitLine;
if (config.Orbit.TrackingOrbitLine || (new Gravity(parentGravity).Power == 1 && ecc != 0))
if (config.Orbit.trackingOrbitLine || (new Gravity(parentGravity).Power == 1 && ecc != 0))
{
orbitLine = orbitGO.AddComponent<TrackingOrbitLine>();
}
@ -57,7 +57,7 @@ namespace NewHorizons.Builder.Orbital
}
var color = Color.white;
if (config.Orbit.Tint != null) color = config.Orbit.Tint;
if (config.Orbit.tint != null) color = config.Orbit.tint;
else if (config.Star != null) color = config.Star.tint;
else if (config.Atmosphere?.clouds?.tint != null) color = config.Atmosphere.clouds.tint;
else if (config.Singularity != null) color = new Color(1f, 0.5f, 1f);

View File

@ -333,7 +333,7 @@ namespace NewHorizons.Builder.Props
{
var a = info.arcInfo[i];
if (a.position == null) arc.transform.localPosition = Vector3.zero;
else arc.transform.localPosition = new Vector3(a.position.X, a.position.Y, 0);
else arc.transform.localPosition = new Vector3(a.position.x, a.position.y, 0);
arc.transform.localRotation = Quaternion.Euler(0, 0, a.zRotation);
}

View File

@ -388,7 +388,7 @@ namespace NewHorizons.Builder.ShipLog
int newLevel = parent.level + 1;
MapModeObject lastSibling = parent;
foreach (NewHorizonsBody body in searchList.Where(b => b.Config.Orbit.PrimaryBody == parent.mainBody.Config.name || b.Config.name == secondaryName))
foreach (NewHorizonsBody body in searchList.Where(b => b.Config.Orbit.primaryBody == parent.mainBody.Config.name || b.Config.name == secondaryName))
{
bool even = newLevel % 2 == 0;
newX = even ? newX : newX + 1;

View File

@ -81,7 +81,7 @@ namespace NewHorizons.Components
var newOrbit = newState.orbit ?? groundState.orbit;
newOrbit.trueAnomaly = Random.Range(0f, 360f);
primaryBody = AstroObjectLocator.GetAstroObject(newOrbit.PrimaryBody);
primaryBody = AstroObjectLocator.GetAstroObject(newOrbit.primaryBody);
var primaryGravity = new Gravity(primaryBody.GetGravityVolume());
var secondaryGravity = new Gravity(_astroObject.GetGravityVolume());
orbitalParams = newOrbit.GetOrbitalParameters(primaryGravity, secondaryGravity);

View File

@ -45,6 +45,7 @@ namespace NewHorizons.Components.SizeControllers
private StarEvolutionController _proxy;
private float maxScale;
private static readonly int ColorRamp = Shader.PropertyToID("_ColorRamp");
void Awake()
{
@ -55,10 +56,10 @@ namespace NewHorizons.Components.SizeControllers
_endSurfaceMaterial = new Material(sun._endSurfaceMaterial);
// Copy over the material that was set in star builder
_collapseStartSurfaceMaterial.SetTexture("_ColorRamp", supernova._surface.sharedMaterial.GetTexture("_ColorRamp"));
_collapseEndSurfaceMaterial.SetTexture("_ColorRamp", supernova._surface.sharedMaterial.GetTexture("_ColorRamp"));
_startSurfaceMaterial.SetTexture("_ColorRamp", supernova._surface.sharedMaterial.GetTexture("_ColorRamp"));
_endSurfaceMaterial.SetTexture("_ColorRamp", supernova._surface.sharedMaterial.GetTexture("_ColorRamp"));
_collapseStartSurfaceMaterial.SetTexture(ColorRamp, supernova._surface.sharedMaterial.GetTexture(ColorRamp));
_collapseEndSurfaceMaterial.SetTexture(ColorRamp, supernova._surface.sharedMaterial.GetTexture(ColorRamp));
_startSurfaceMaterial.SetTexture(ColorRamp, supernova._surface.sharedMaterial.GetTexture(ColorRamp));
_endSurfaceMaterial.SetTexture(ColorRamp, supernova._surface.sharedMaterial.GetTexture(ColorRamp));
if (startColour == null)
{

View File

@ -160,7 +160,7 @@ namespace NewHorizons.External.Configs
public void MigrateAndValidate()
{
// Validate
if (Base.centerOfSolarSystem) Orbit.IsStatic = true;
if (Base.centerOfSolarSystem) Orbit.isStatic = true;
if (Atmosphere?.clouds?.lightningGradient != null) Atmosphere.clouds.hasLightning = true;
// Backwards compatability

View File

@ -2,67 +2,69 @@
using System.ComponentModel.DataAnnotations;
using NewHorizons.Components.Orbital;
using NewHorizons.Utility;
using Newtonsoft.Json;
namespace NewHorizons.External.Modules
{
[JsonObject]
public class OrbitModule : IOrbitalParameters
{
/// <summary>
/// The name of the body this one will orbit around
/// </summary>
public string PrimaryBody { get; set; }
public string primaryBody;
/// <summary>
/// Is this the moon of a planet? Used for determining when its name is shown on the map.
/// </summary>
public bool IsMoon { get; set; }
public bool isMoon;
/// <summary>
/// The angle between the normal to the orbital plane and its axis of rotation.
/// </summary>
public float AxialTilt { get; set; }
public float axialTilt;
/// <summary>
/// Rotation period in minutes.
/// </summary>
public float SiderealPeriod { get; set; }
public float siderealPeriod;
/// <summary>
/// Should the body always have one side facing its primary?
/// </summary>
public bool IsTidallyLocked { get; set; }
public bool isTidallyLocked;
/// <summary>
/// If it is tidally locked, this direction will face towards the primary. Ex: Interloper uses `0, -1, 0`. Most planets
/// will want something like `-1, 0, 0`.
/// </summary>
public MVector3 AlignmentAxis { get; set; }
public MVector3 alignmentAxis;
/// <summary>
/// Referring to the orbit line in the map screen.
/// </summary>
[DefaultValue(true)]
public bool ShowOrbitLine { get; set; } = true;
public bool showOrbitLine = true;
/// <summary>
/// Should the orbit line be dotted?
/// </summary>
public bool DottedOrbitLine { get; set; } = false;
public bool dottedOrbitLine;
/// <summary>
/// Is the body meant to stay in one place without moving?
/// </summary>
public bool IsStatic { get; set; }
public bool isStatic;
/// <summary>
/// Colour of the orbit-line in the map view.
/// </summary>
public MColor Tint { get; set; }
public MColor tint;
/// <summary>
/// Should we just draw a line behind its orbit instead of the entire circle/ellipse?
/// </summary>
public bool TrackingOrbitLine { get; set; }
public bool trackingOrbitLine;
/// <summary>
/// The semi-major axis of the ellipse that is the body's orbit. For a circular orbit this is the radius.

View File

@ -266,14 +266,14 @@ namespace NewHorizons.Handlers
public static GameObject GenerateBody(NewHorizonsBody body, bool defaultPrimaryToSun = false)
{
AstroObject primaryBody;
if (body.Config.Orbit.PrimaryBody != null)
if (body.Config.Orbit.primaryBody != null)
{
primaryBody = AstroObjectLocator.GetAstroObject(body.Config.Orbit.PrimaryBody);
primaryBody = AstroObjectLocator.GetAstroObject(body.Config.Orbit.primaryBody);
if (primaryBody == null)
{
if (defaultPrimaryToSun)
{
Logger.Log($"Couldn't find {body.Config.Orbit.PrimaryBody}, defaulting to Sun");
Logger.Log($"Couldn't find {body.Config.Orbit.primaryBody}, defaulting to Sun");
primaryBody = AstroObjectLocator.GetAstroObject("Sun");
}
else
@ -341,12 +341,12 @@ namespace NewHorizons.Handlers
Main.SystemDict[body.Config.starSystem].SpawnPoint = SpawnPointBuilder.Make(go, body.Config.Spawn, owRigidBody);
}
if (body.Config.Orbit.ShowOrbitLine && !body.Config.Orbit.IsStatic)
if (body.Config.Orbit.showOrbitLine && !body.Config.Orbit.isStatic)
{
Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => OrbitlineBuilder.Make(body.Object, ao as NHAstroObject, body.Config.Orbit.IsMoon, body.Config));
Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => OrbitlineBuilder.Make(body.Object, ao as NHAstroObject, body.Config.Orbit.isMoon, body.Config));
}
if (!body.Config.Orbit.IsStatic)
if (!body.Config.Orbit.isStatic)
{
DetectorBuilder.Make(go, owRigidBody, primaryBody, ao, body.Config);
}
@ -507,10 +507,10 @@ namespace NewHorizons.Handlers
// By default keep it with the same primary body else update to the new one
var primary = ao._primaryBody;
if (!string.IsNullOrEmpty(body.Config.Orbit.PrimaryBody))
if (!string.IsNullOrEmpty(body.Config.Orbit.primaryBody))
{
// If we can't find the new one we want to try again later (return false)
primary = AstroObjectLocator.GetAstroObject(body.Config.Orbit.PrimaryBody);
primary = AstroObjectLocator.GetAstroObject(body.Config.Orbit.primaryBody);
if (primary == null) return;
}
@ -539,7 +539,7 @@ namespace NewHorizons.Handlers
GameObject.Destroy(go.GetComponentInChildren<OrbitLine>().gameObject);
var isMoon = newAO.GetAstroObjectType() == AstroObject.Type.Moon || newAO.GetAstroObjectType() == AstroObject.Type.Satellite;
if (body.Config.Orbit.ShowOrbitLine) OrbitlineBuilder.Make(go, newAO, isMoon, body.Config);
if (body.Config.Orbit.showOrbitLine) OrbitlineBuilder.Make(go, newAO, isMoon, body.Config);
DetectorBuilder.SetDetector(primary, newAO, go.GetComponentInChildren<ConstantForceDetector>());

View File

@ -74,12 +74,12 @@ namespace NewHorizons.Handlers
childBodies.Add(bodies[j]);
}
// If uh the primary body straight up matches the name
else if (bodies[j].Config.Orbit.PrimaryBody == bodies[i].Config.name)
else if (bodies[j].Config.Orbit.primaryBody == bodies[i].Config.name)
{
childBodies.Add(bodies[j]);
}
// If finding the astro object of the primary body matches the astro object but not null bc if its a new planet it'll always be null
else if (AstroObjectLocator.GetAstroObject(bodies[j].Config.Orbit.PrimaryBody) == astroObjects[i] && astroObjects[i] != null)
else if (AstroObjectLocator.GetAstroObject(bodies[j].Config.Orbit.primaryBody) == astroObjects[i] && astroObjects[i] != null)
{
childBodies.Add(bodies[j]);
}
@ -119,7 +119,7 @@ namespace NewHorizons.Handlers
private static bool DetermineIfChildOfFocal(NewHorizonsBody body, FocalPointNode node)
{
var name = body.Config.name.ToLower();
var primary = (body.Config.Orbit?.PrimaryBody ?? "").ToLower();
var primary = (body.Config.Orbit?.primaryBody ?? "").ToLower();
var primaryName = node.primary.body.Config.name.ToLower();
var secondaryName = node.secondary.body.Config.name.ToLower();
return name != primaryName && name != secondaryName && (primary == node.body.Config.name.ToLower() || primary == primaryName || primary == secondaryName);
@ -134,7 +134,7 @@ namespace NewHorizons.Handlers
{
body = body,
children = bodies
.Where(b => string.Equals(b.Config.Orbit.PrimaryBody, body.Config.name, StringComparison.CurrentCultureIgnoreCase))
.Where(b => string.Equals(b.Config.Orbit.primaryBody, body.Config.name, StringComparison.CurrentCultureIgnoreCase))
.Select(b => ConstructGraph(b, bodies))
};
}

View File

@ -17,7 +17,7 @@ using UnityEngine.Events;
using UnityEngine.SceneManagement;
using Logger = NewHorizons.Utility.Logger;
using NewHorizons.Utility.DebugUtilities;
using Newtonsoft.Json.Schema;
using Newtonsoft.Json;
namespace NewHorizons
{
@ -113,25 +113,8 @@ namespace NewHorizons
TextTranslation.Get().SetLanguage(TextTranslation.Get().GetLanguage());
}
#region Assembly Stuff
public static Assembly ResolveAssembly(object sender, ResolveEventArgs e)
{
Logger.LogError($"Couldn't resolve assembly: {e.Name} from {e.RequestingAssembly.FullName}... Trying to fix it.");
if (e.Name.Contains("Namotion.Reflection"))
return Assembly.LoadFrom("Namotion.Reflection.dll");
else if (e.Name.Contains("Microsoft.CSharp"))
return Assembly.LoadFrom("Microsoft.CSharp.dll");
else
return null;
}
#endregion
public void Start()
{
AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly;
// Patches
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
@ -385,11 +368,6 @@ namespace NewHorizons
Logger.Log($"Registering {language} translation from {mod.ModHelper.Manifest.Name} from {relativeFile}");
var config = new TranslationConfig($"{folder}{relativeFile}");
if (config == null)
{
Logger.Log($"Found {folder}{relativeFile} but couldn't load it");
continue;
}
foundFile = true;
@ -405,9 +383,11 @@ namespace NewHorizons
try
{
var config = mod.ModHelper.Storage.Load<PlanetConfig>(relativeDirectory);
// var config = JsonConvert.DeserializeObject<PlanetConfig>(File.ReadAllText($"{mod.ModHelper.Manifest.ModFolderPath}/{relativeDirectory}"));
config.MigrateAndValidate();
Logger.Log($"Loaded {config.name}");
Logger.Log($"Loaded {config.name}");
if (!SystemDict.ContainsKey(config.starSystem))
{

View File

@ -1,55 +1,60 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{8A39F9E7-1A89-430C-9C3E-BDFB3B7E17DF}</ProjectGuid>
<TargetFramework>net48</TargetFramework>
<OutputPath>Build</OutputPath>
<AssemblyTitle>NewHorizons</AssemblyTitle>
<Product>NewHorizons</Product>
<Copyright>Copyright © 2020</Copyright>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>portable</DebugType>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<Reference Include="..\NJsonSchema\*.dll" />
<PackageReference Include="HarmonyX" Version="2.10.0" />
<PackageReference Include="OWML" Version="2.3.3" />
<PackageReference Include="OuterWildsGameLibs" Version="1.1.12.168" />
</ItemGroup>
<ItemGroup>
<None Include="default-config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="manifest.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="AssetBundle\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="NewHorizons.csproj.user" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<PropertyGroup>
<ProjectGuid>{8A39F9E7-1A89-430C-9C3E-BDFB3B7E17DF}</ProjectGuid>
<TargetFramework>net48</TargetFramework>
<OutputPath>Build</OutputPath>
<AssemblyTitle>NewHorizons</AssemblyTitle>
<Product>NewHorizons</Product>
<Copyright>Copyright © 2020</Copyright>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>portable</DebugType>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HarmonyX" Version="2.10.0"/>
<PackageReference Include="OWML" Version="2.3.3"/>
<PackageReference Include="OuterWildsGameLibs" Version="1.1.12.168"/>
<Reference Include="System.ComponentModel.Annotations">
<HintPath>../System.ComponentModel.Annotations/System.ComponentModel.Annotations.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="../System.ComponentModel.Annotations/System.ComponentModel.Annotations.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="default-config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="manifest.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="AssetBundle\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="NewHorizons.csproj.user"/>
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
</Project>

View File

@ -3,18 +3,20 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace NewHorizons.Utility
{
[JsonObject]
public class MGradient
{
public MGradient(float time, MColor tint)
{
Time = time;
Tint = tint;
this.time = time;
this.tint = tint;
}
public float Time { get; }
public MColor Tint { get; }
public float time;
public MColor tint;
}
}

View File

@ -1,16 +1,23 @@
using UnityEngine;
#region
using Newtonsoft.Json;
using UnityEngine;
#endregion
namespace NewHorizons.Utility
{
[JsonObject]
public class MVector2
{
public MVector2(float x, float y)
{
X = x;
Y = y;
this.x = x;
this.y = y;
}
public float X { get; }
public float Y { get; }
public float x;
public float y;
public static implicit operator MVector2(Vector2 vec)
{
@ -19,7 +26,7 @@ namespace NewHorizons.Utility
public static implicit operator Vector2(MVector2 vec)
{
return new Vector2(vec.X, vec.Y);
return new Vector2(vec.x, vec.y);
}
}
}

View File

@ -1,18 +1,20 @@
using UnityEngine;
using Newtonsoft.Json;
using UnityEngine;
namespace NewHorizons.Utility
{
[JsonObject]
public class MVector3
{
public MVector3(float x, float y, float z)
{
X = x;
Y = y;
Z = z;
this.x = x;
this.y = y;
this.z = z;
}
public float X { get; }
public float Y { get; }
public float Z { get; }
public float x;
public float y;
public float z;
public static implicit operator MVector3(Vector3 vec)
{
@ -21,7 +23,7 @@ namespace NewHorizons.Utility
public static implicit operator Vector3(MVector3 vec)
{
return new Vector3(vec.X, vec.Y, vec.Z);
return new Vector3(vec.x, vec.y, vec.z);
}
}
}

View File

@ -1,6 +1,5 @@
using System;
using System.IO;
using System.Linq;
using NewHorizons.External.Configs;
using NJsonSchema;
using NJsonSchema.Generation;

View File

@ -7,6 +7,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
@ -27,6 +28,6 @@
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NewHorizons\NewHorizons.csproj" />
<ProjectReference Include="..\NewHorizons\NewHorizons.csproj"/>
</ItemGroup>
</Project>