mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
feat: added delete/undo and cleaned up the name of the property that lets you set what object is being placed
This commit is contained in:
parent
b7f3a587f7
commit
009d9b075a
@ -27,6 +27,7 @@ namespace NewHorizons.Utility
|
||||
// placeholder currentObject
|
||||
public static string currentObject = "BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District1/Props_HangingCity_District1/OtherComponentsGroup/Props_HangingCity_Building_10/Prefab_NOM_VaseThin";
|
||||
private static List<PropPlacementData> props = new List<PropPlacementData>();
|
||||
private static List<PropPlacementData> deletedProps = new List<PropPlacementData>();
|
||||
|
||||
// TODO: RegisterProp function, call it in DetailBuilder.MakeDetail
|
||||
// TODO: Add default rotation and position offsets
|
||||
@ -118,5 +119,29 @@ namespace NewHorizons.Utility
|
||||
Logger.Log(configFile);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteLast()
|
||||
{
|
||||
if (props.Count <= 0) return;
|
||||
|
||||
PropPlacementData last = props[props.Count-1];
|
||||
props.RemoveAt(props.Count-1);
|
||||
|
||||
last.gameObject.SetActive(false);
|
||||
|
||||
deletedProps.Add(last);
|
||||
}
|
||||
|
||||
public static void UndoDelete()
|
||||
{
|
||||
if (deletedProps.Count <= 0) return;
|
||||
|
||||
PropPlacementData last = deletedProps[deletedProps.Count-1];
|
||||
deletedProps.RemoveAt(deletedProps.Count-1);
|
||||
|
||||
last.gameObject.SetActive(true);
|
||||
|
||||
props.Add(last);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ namespace NewHorizons.Utility
|
||||
private GameObject _normalSphere1;
|
||||
private GameObject _normalSphere2;
|
||||
|
||||
public string temp_placepath = "BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District1/Props_HangingCity_District1/OtherComponentsGroup/Props_HangingCity_Building_10/Prefab_NOM_VaseThin";
|
||||
public string PropToPlace = "BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_HangingCity/Sector_HangingCity_District1/Props_HangingCity_District1/OtherComponentsGroup/Props_HangingCity_Building_10/Prefab_NOM_VaseThin";
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@ -44,7 +44,7 @@ namespace NewHorizons.Utility
|
||||
|
||||
if (Keyboard.current[Key.L].wasReleasedThisFrame)
|
||||
{
|
||||
DebugPropPlacer.currentObject = temp_placepath;
|
||||
DebugPropPlacer.currentObject = PropToPlace;
|
||||
PlaceObject();
|
||||
}
|
||||
|
||||
@ -52,6 +52,16 @@ namespace NewHorizons.Utility
|
||||
{
|
||||
DebugPropPlacer.PrintConfig();
|
||||
}
|
||||
|
||||
if (Keyboard.current[Key.Minus].wasReleasedThisFrame)
|
||||
{
|
||||
DebugPropPlacer.DeleteLast();
|
||||
}
|
||||
|
||||
if (Keyboard.current[Key.Equals].wasReleasedThisFrame)
|
||||
{
|
||||
DebugPropPlacer.UndoDelete();
|
||||
}
|
||||
}
|
||||
|
||||
internal void PlaceObject()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user