mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix warp pads
This commit is contained in:
parent
d847f13e83
commit
0c619e0fd1
@ -1,11 +1,6 @@
|
|||||||
using NewHorizons.External.Modules;
|
using NewHorizons.External.Modules;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using NewHorizons.Utility.OWUtilities;
|
using NewHorizons.Utility.OWUtilities;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Logger = NewHorizons.Utility.Logger;
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@ using NewHorizons.Utility;
|
|||||||
using NewHorizons.Utility.OWMLUtilities;
|
using NewHorizons.Utility.OWMLUtilities;
|
||||||
using OWML.Utils;
|
using OWML.Utils;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using Logger = NewHorizons.Utility.Logger;
|
||||||
|
|
||||||
namespace NewHorizons.Builder.Props
|
namespace NewHorizons.Builder.Props
|
||||||
{
|
{
|
||||||
@ -84,7 +85,10 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
public static void Make(GameObject planetGO, Sector sector, NomaiWarpReceiverInfo info)
|
public static void Make(GameObject planetGO, Sector sector, NomaiWarpReceiverInfo info)
|
||||||
{
|
{
|
||||||
var receiverObject = DetailBuilder.Make(planetGO, sector, info.detailed ? _detailedReceiverPrefab : _receiverPrefab, new PropModule.DetailInfo(info));
|
var detailInfo = new PropModule.DetailInfo(info);
|
||||||
|
var receiverObject = DetailBuilder.Make(planetGO, sector, info.detailed ? _detailedReceiverPrefab : _receiverPrefab, detailInfo);
|
||||||
|
|
||||||
|
Logger.Log($"Position is {detailInfo.position} was {info.position}");
|
||||||
|
|
||||||
var receiver = receiverObject.GetComponentInChildren<NomaiWarpReceiver>();
|
var receiver = receiverObject.GetComponentInChildren<NomaiWarpReceiver>();
|
||||||
|
|
||||||
|
|||||||
14
NewHorizons/External/Modules/PropModule.cs
vendored
14
NewHorizons/External/Modules/PropModule.cs
vendored
@ -3,6 +3,7 @@ using NewHorizons.External.Modules.WarpPad;
|
|||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Serialization;
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
@ -177,20 +178,9 @@ namespace NewHorizons.External.Modules
|
|||||||
{
|
{
|
||||||
public DetailInfo() { }
|
public DetailInfo() { }
|
||||||
|
|
||||||
public DetailInfo(GeneralPropInfo info)
|
|
||||||
{
|
|
||||||
foreach (var prop in info.GetType().GetProperties())
|
|
||||||
{
|
|
||||||
GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(info, null), null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public DetailInfo(GeneralPointPropInfo info)
|
public DetailInfo(GeneralPointPropInfo info)
|
||||||
{
|
{
|
||||||
foreach (var prop in info.GetType().GetProperties())
|
JsonConvert.PopulateObject(JsonConvert.SerializeObject(info), this);
|
||||||
{
|
|
||||||
GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(info, null), null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user