internal static void OnNativeFunctionsRegistered() { IConsoleManager.Get().RegisterConsoleCommand("USharpGen", "USharp generate C# code", GenerateCode); //IConsoleManager.Get().RegisterConsoleCommand("USharpGenSliced", "USharp generate C# code", GenerateCodeTimeSliced); IConsoleManager.Get().RegisterConsoleCommand("USharpMinHotReload", "USharp hotreload will skip reintancing / CDO checks", SetMinimalHotReload); }
internal static void OnNativeFunctionsRegistered() { IConsoleManager.Get().RegisterConsoleCommand("USharpGen", "USharp generate C# code", GenerateCode); // Move these commands somewhere else? IConsoleManager.Get().RegisterConsoleCommand("USharpRuntime", "Sets the .NET runtime that USharp will use (Mono/CLR)", SetDotNetRuntime); IConsoleManager.Get().RegisterConsoleCommand("USharpMinHotReload", "USharp hotreload will skip reintancing / CDO checks", SetMinimalHotReload); }
public static IConsoleManager Get() { IntPtr address = Native_IConsoleManager.Get(); if (singleton == null || singleton.Address != address) { singleton = new IConsoleManager(address); } return(singleton); }
internal static void OnUnload() { Debug.Assert(FThreading.IsInGameThread(), "Load/hotreload should be on the game thread"); //if (!FThreading.IsInGameThread()) //{ // FThreading.RunUnloader(delegate { OnUnload(); }); // return; //} Data = new DataStore(); IsUnloading = true; try { if (UnloadBegin != null) { UnloadBegin(); } } catch (Exception e) { FMessage.Log(ELogVerbosity.Error, "HotReload.UnloadBegin failed. Exception: " + Environment.NewLine + e); } Engine.FUSharpLatentAction.OnUnload(); Engine.ManagedLatentCallbackHelper.UnregisterCallbacks(); StaticVarManager.OnUnload(); EngineLoop.OnUnload(); FThreading.OnUnload(); FTicker.OnUnload(); IConsoleManager.OnUnload(); ManagedUnrealTypes.OnUnload(); GCHelper.OnUnload(); UnbindNativeDelegates(); IsUnloaded = true; try { if (UnloadEnd != null) { UnloadEnd(); } } catch (Exception e) { FMessage.Log(ELogVerbosity.Error, "HotReload.UnloadEnd failed. Exception: " + Environment.NewLine + e); } }
internal static void OnUnload() { IConsoleManager consoleManager = IConsoleManager.Get(); foreach (var command in new Dictionary <IntPtr, ManagedCommand>(managedCommands)) { consoleManager.UnregisterConsoleObject(command.Value.NativeCommand); } foreach (var handler in new Dictionary <FDelegateHandle, FConsoleCommandDelegate>(managedVariableSinkHandlers)) { consoleManager.UnregisterConsoleVariableSink(handler.Key); } foreach (var handler in new Dictionary <IntPtr, ManagedVariableChangedHandler>(managedVariableOnChangedHandlers)) { consoleManager.UnregisterConsoleObject(new IConsoleVariable(handler.Key)); } managedVariableOnChangedHandlers.Clear(); managedVariableSinkHandlers.Clear(); managedCommands.Clear(); }
public void SetOnChangedCallback(FConsoleVariableDelegate callback) { IConsoleManager.Get().SetOnChangedCallback(this, callback); }