Code updates
This commit is contained in:
parent
a430310324
commit
393de5e06a
14 changed files with 216 additions and 31 deletions
7
Patches/AITrafficLight_EnableGreenLight_Patch.cs
Normal file
7
Patches/AITrafficLight_EnableGreenLight_Patch.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
using HarmonyLib;
|
||||
using TurnTheGameOn.SimpleTrafficSystem;
|
||||
|
||||
namespace SpacemarketSimulator.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(AITrafficLight), "EnableGreenLight")] public static class AITrafficLight_EnableGreenLight_Patch { public static void Postfix(AITrafficLight __instance) => __instance.DisableAllLights(); }
|
||||
}
|
||||
7
Patches/AITrafficLight_EnableRedLight_Patch.cs
Normal file
7
Patches/AITrafficLight_EnableRedLight_Patch.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
using HarmonyLib;
|
||||
using TurnTheGameOn.SimpleTrafficSystem;
|
||||
|
||||
namespace SpacemarketSimulator.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(AITrafficLight), "EnableRedLight")] public static class AITrafficLight_EnableRedLight_Patch { public static void Postfix(AITrafficLight __instance) => __instance.DisableAllLights(); }
|
||||
}
|
||||
7
Patches/AITrafficLight_EnableYellowLight_Patch.cs
Normal file
7
Patches/AITrafficLight_EnableYellowLight_Patch.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
using HarmonyLib;
|
||||
using TurnTheGameOn.SimpleTrafficSystem;
|
||||
|
||||
namespace SpacemarketSimulator.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(AITrafficLight), "EnableYellowLight")] public static class AITrafficLight_EnableYellowLight_Patch { public static void Postfix(AITrafficLight __instance) => __instance.DisableAllLights(); }
|
||||
}
|
||||
14
Patches/CinemachineVirtualCamera_CalculateNewState_Patch.cs
Normal file
14
Patches/CinemachineVirtualCamera_CalculateNewState_Patch.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using Cinemachine;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace SpacemarketSimulator.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(CinemachineVirtualCamera), "CalculateNewState")]
|
||||
public static class CinemachineVirtualCamera_CalculateNewState_Patch
|
||||
{
|
||||
public static void Postfix(ref CameraState __result)
|
||||
{
|
||||
__result.Lens.FarClipPlane = 1500;
|
||||
}
|
||||
}
|
||||
}
|
||||
21
Patches/MainMenuManager_Awake_Patch.cs
Normal file
21
Patches/MainMenuManager_Awake_Patch.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using HarmonyLib;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SpacemarketSimulator.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(MainMenuManager), "Awake")]
|
||||
public static class MainMenuManager_Awake_Patch
|
||||
{
|
||||
public static void Postfix(MainMenuManager __instance)
|
||||
{
|
||||
var bg = new Texture2D(1920, 1080);
|
||||
bg.LoadImage(Properties.Resources.bg);
|
||||
var image = __instance.gameObject.transform.GetChild(0).gameObject.GetComponent<Image>();
|
||||
Console.WriteLine(image == null);
|
||||
image.sprite = Sprite.Create(bg, new Rect(0, 0, bg.width, bg.height), new Vector2(0.5f, 0.5f)); ;
|
||||
__instance.gameObject.transform.GetChild(1).gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Patches/NPCTrafficManager_SpawnNPC_Patch.cs
Normal file
16
Patches/NPCTrafficManager_SpawnNPC_Patch.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using HarmonyLib;
|
||||
using System.Linq;
|
||||
|
||||
namespace SpacemarketSimulator.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(NPCTrafficManager), "SpawnNPC")]
|
||||
public static class NPCTrafficManager_SpawnNPC_Patch
|
||||
{
|
||||
public static void Postfix(NPCTrafficManager __instance)
|
||||
{
|
||||
WaypointNavigator npc = __instance.m_ActiveNPCs.Last();
|
||||
|
||||
npc.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Patches/SectionManager_UpgradeStore_Patch.cs
Normal file
13
Patches/SectionManager_UpgradeStore_Patch.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using HarmonyLib;
|
||||
|
||||
namespace SpacemarketSimulator.Patches
|
||||
{
|
||||
[HarmonyPatch(typeof(SectionManager), "UpgradeStore")]
|
||||
public static class SectionManager_UpgradeStore_Patch
|
||||
{
|
||||
public static void Postfix()
|
||||
{
|
||||
//Plugin.DisableStandardEnvironment();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue