mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
Move many mods to Deprecated folder, fix spelling
This commit is contained in:
parent
5e822cec8d
commit
0042590aa6
539 changed files with 7475 additions and 3120 deletions
|
@ -2,17 +2,21 @@
|
|||
using ABI.Scripting.CVRSTL.Client;
|
||||
using System.Diagnostics;
|
||||
using MTJobSystem;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.CVRLuaToolsExtension;
|
||||
|
||||
public static class CVRLuaClientBehaviourExtensions
|
||||
{
|
||||
internal static readonly Dictionary<CVRLuaClientBehaviour, bool> _isRestarting = new();
|
||||
private static string PersistentDataPath;
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public static void Restart(this CVRLuaClientBehaviour behaviour)
|
||||
{
|
||||
PersistentDataPath ??= Application.persistentDataPath; // needs to be set on main
|
||||
|
||||
if (_isRestarting.TryGetValue(behaviour, out bool isRestarting) && isRestarting)
|
||||
{
|
||||
CVRLuaToolsExtensionMod.Logger.Warning($"Restart is already in progress for {behaviour.ScriptName}.");
|
||||
|
@ -105,7 +109,7 @@ public static class CVRLuaClientBehaviourExtensions
|
|||
behaviour.LogInfo("[CVRLuaToolsExtension] Resetting script...\n");
|
||||
|
||||
behaviour.script = null;
|
||||
behaviour.script = LuaScriptFactory.ForLuaBehaviour(behaviour, boundObjectEntries, behaviour.gameObject, behaviour.transform);
|
||||
behaviour.script = LuaScriptFactory.ForLuaBehaviour(behaviour, boundObjectEntries, behaviour.gameObject, behaviour.transform, PersistentDataPath);
|
||||
|
||||
behaviour.InitTimerIfNeeded(); // only null if crashed prior
|
||||
behaviour.script.AttachDebugger(behaviour.timer); // reattach the debugger
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue