From 49fcc959f4077736d62aa9f3ff3d716c887c3dc1 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Thu, 18 Jan 2024 21:38:01 -0500 Subject: [PATCH] also use sourcegen for controller loaders --- Assets/Scripts/InputSystem/InputController.cs | 9 +- Assets/Scripts/InputSystem/PlayerInput.cs | 72 +++--- Assets/Scripts/InputSystem/USG.g.meta | 8 + ...PlayerInput.ControllerLoaderGenerator.g.cs | 59 +++++ ...rInput.ControllerLoaderGenerator.g.cs.meta | 11 + Assets/Scripts/SourceGenerators.meta | 8 + .../ControllerLoaderGenerator.cs | 130 +++++++++++ .../ControllerLoaderGenerator.cs.meta | 11 + .../MinigameLoaderGenerator.cs | 8 +- .../MinigameLoaderGenerator.cs.meta | 0 ...mes.Minigames.MinigameLoaderGenerator.g.cs | 214 +++++------------- ...Generator.Editor.ProjectSettingsData.asset | 11 +- 12 files changed, 332 insertions(+), 209 deletions(-) create mode 100644 Assets/Scripts/InputSystem/USG.g.meta create mode 100644 Assets/Scripts/InputSystem/USG.g/InitInputControllers.PlayerInput.ControllerLoaderGenerator.g.cs create mode 100644 Assets/Scripts/InputSystem/USG.g/InitInputControllers.PlayerInput.ControllerLoaderGenerator.g.cs.meta create mode 100644 Assets/Scripts/SourceGenerators.meta create mode 100644 Assets/Scripts/SourceGenerators/ControllerLoaderGenerator.cs create mode 100644 Assets/Scripts/SourceGenerators/ControllerLoaderGenerator.cs.meta rename Assets/Scripts/{ => SourceGenerators}/MinigameLoaderGenerator.cs (95%) rename Assets/Scripts/{ => SourceGenerators}/MinigameLoaderGenerator.cs.meta (100%) diff --git a/Assets/Scripts/InputSystem/InputController.cs b/Assets/Scripts/InputSystem/InputController.cs index 00ecf70a..4f2a50b3 100644 --- a/Assets/Scripts/InputSystem/InputController.cs +++ b/Assets/Scripts/InputSystem/InputController.cs @@ -182,7 +182,14 @@ namespace HeavenStudio.InputSystem if (File.Exists(path)) { string json = File.ReadAllText(path); - currentBindings = JsonUtility.FromJson(json); + if (json is not null or "") + { + currentBindings = JsonUtility.FromJson(json); + } + else + { + ResetBindings(); + } } else { diff --git a/Assets/Scripts/InputSystem/PlayerInput.cs b/Assets/Scripts/InputSystem/PlayerInput.cs index f8668236..cec570b7 100644 --- a/Assets/Scripts/InputSystem/PlayerInput.cs +++ b/Assets/Scripts/InputSystem/PlayerInput.cs @@ -1,15 +1,12 @@ using System; using System.Linq; using System.Reflection; -using System.IO; -using System.Collections; + using System.Collections.Generic; -using UnityEngine; + using HeavenStudio.InputSystem; -using static JSL; -using HeavenStudio.Games; -using System.Diagnostics.Contracts; +using SatorImaging.UnitySourceGenerator; namespace HeavenStudio.InputSystem { @@ -25,7 +22,8 @@ namespace HeavenStudio.InputSystem namespace HeavenStudio { - public class PlayerInput + [UnitySourceGenerator(typeof(ControllerLoaderGenerator), OverwriteIfFileExists = false)] + public partial class PlayerInput { public class InputAction { @@ -57,40 +55,40 @@ namespace HeavenStudio public delegate InputController[] InputControllerRefresh(); public static List PlayerInputRefresh; - static List loadRunners; - static void BuildLoadRunnerList() - { - PlayerInputRefresh = new(); - loadRunners = System.Reflection.Assembly.GetExecutingAssembly() - .GetTypes() - .Where(x => x.Namespace == "HeavenStudio.InputSystem.Loaders" && x.GetMethod("Initialize", BindingFlags.Public | BindingFlags.Static) != null) - .Select(t => (InputControllerInitializer)Delegate.CreateDelegate( - typeof(InputControllerInitializer), - null, - t.GetMethod("Initialize", BindingFlags.Public | BindingFlags.Static), - false - )) - .ToList(); + // static List loadRunners; + // static void BuildLoadRunnerList() + // { + // PlayerInputRefresh = new(); + // loadRunners = System.Reflection.Assembly.GetExecutingAssembly() + // .GetTypes() + // .Where(x => x.Namespace == "HeavenStudio.InputSystem.Loaders" && x.GetMethod("Initialize", BindingFlags.Public | BindingFlags.Static) != null) + // .Select(t => (InputControllerInitializer)Delegate.CreateDelegate( + // typeof(InputControllerInitializer), + // null, + // t.GetMethod("Initialize", BindingFlags.Public | BindingFlags.Static), + // false + // )) + // .ToList(); - loadRunners.Sort((x, y) => x.Method.GetCustomAttribute().Order.CompareTo(y.Method.GetCustomAttribute().Order)); - } + // loadRunners.Sort((x, y) => x.Method.GetCustomAttribute().Order.CompareTo(y.Method.GetCustomAttribute().Order)); + // } - public static int InitInputControllers() - { - inputDevices = new List(); + // public static int InitInputControllers() + // { + // inputDevices = new List(); - BuildLoadRunnerList(); - foreach (InputControllerInitializer runner in loadRunners) - { - InputController[] controllers = runner(); - if (controllers != null) - { - inputDevices.AddRange(controllers); - } - } + // BuildLoadRunnerList(); + // foreach (InputControllerInitializer runner in loadRunners) + // { + // InputController[] controllers = runner(); + // if (controllers != null) + // { + // inputDevices.AddRange(controllers); + // } + // } - return inputDevices.Count; - } + // return inputDevices.Count; + // } public static int RefreshInputControllers() { diff --git a/Assets/Scripts/InputSystem/USG.g.meta b/Assets/Scripts/InputSystem/USG.g.meta new file mode 100644 index 00000000..4edc7ff6 --- /dev/null +++ b/Assets/Scripts/InputSystem/USG.g.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 91d174098996c5f4ea7ea011d63d65db +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/InputSystem/USG.g/InitInputControllers.PlayerInput.ControllerLoaderGenerator.g.cs b/Assets/Scripts/InputSystem/USG.g/InitInputControllers.PlayerInput.ControllerLoaderGenerator.g.cs new file mode 100644 index 00000000..0dece7f9 --- /dev/null +++ b/Assets/Scripts/InputSystem/USG.g/InitInputControllers.PlayerInput.ControllerLoaderGenerator.g.cs @@ -0,0 +1,59 @@ +// ControllerLoaderGenerator + +using System; +using System.Linq; +using System.Reflection; + +using System.Collections.Generic; + +using HeavenStudio.InputSystem; +using HeavenStudio.InputSystem.Loaders; +using Debug = UnityEngine.Debug; + +namespace HeavenStudio +{ + partial class PlayerInput + { + + public static int InitInputControllers() + { + + InputController[] controllers; + PlayerInputRefresh = new(); + + controllers = InputJoyshockInitializer.Initialize(); + if (controllers != null) + { + inputDevices.AddRange(controllers); + } + else + { + Debug.Log("InputJoyshockInitializer.Initialize had no controllers to initialize."); + } + + controllers = InputKeyboardInitializer.Initialize(); + if (controllers != null) + { + inputDevices.AddRange(controllers); + } + else + { + Debug.Log("InputKeyboardInitializer.Initialize had no controllers to initialize."); + } + + controllers = InputMouseInitializer.Initialize(); + if (controllers != null) + { + inputDevices.AddRange(controllers); + } + else + { + Debug.Log("InputMouseInitializer.Initialize had no controllers to initialize."); + } + + return inputDevices.Count; + + } + + } +} diff --git a/Assets/Scripts/InputSystem/USG.g/InitInputControllers.PlayerInput.ControllerLoaderGenerator.g.cs.meta b/Assets/Scripts/InputSystem/USG.g/InitInputControllers.PlayerInput.ControllerLoaderGenerator.g.cs.meta new file mode 100644 index 00000000..c117edd0 --- /dev/null +++ b/Assets/Scripts/InputSystem/USG.g/InitInputControllers.PlayerInput.ControllerLoaderGenerator.g.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0eb2420494f0797478ab004aa2105fdc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/SourceGenerators.meta b/Assets/Scripts/SourceGenerators.meta new file mode 100644 index 00000000..b50e3e4e --- /dev/null +++ b/Assets/Scripts/SourceGenerators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b6fd3363f22afb8479c537cbd0281a80 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/SourceGenerators/ControllerLoaderGenerator.cs b/Assets/Scripts/SourceGenerators/ControllerLoaderGenerator.cs new file mode 100644 index 00000000..488835cc --- /dev/null +++ b/Assets/Scripts/SourceGenerators/ControllerLoaderGenerator.cs @@ -0,0 +1,130 @@ +using static SatorImaging.UnitySourceGenerator.USGFullNameOf; +using SatorImaging.UnitySourceGenerator; +using System; +using System.Text; +using System.Linq; +using System.Reflection; +using System.Collections.Generic; +using Debug = UnityEngine.Debug; +using Object = UnityEngine.Object; +#if UNITY_EDITOR +using UnityEditor; +#endif + +using HeavenStudio; +using HeavenStudio.InputSystem; + +// HOW TO USE: Add the following attribute to *target* class. +// Note that target class must be defined as partial. +//[UnitySourceGenerator(typeof(ControllerLoaderGenerator), OverwriteIfFileExists = false)] +public partial class ControllerLoaderGenerator +{ +#if UNITY_EDITOR // USG: class definition is required to avoid build error but methods are not. +#pragma warning disable IDE0051 + + readonly static string MEMBER_ACCESS = "public static"; + readonly static string MAIN_MEMBER_NAME = "InitInputControllers"; + static string OutputFileName() => MAIN_MEMBER_NAME + ".cs"; // -> Name...g.cs + + static bool Emit(USGContext context, StringBuilder sb) + { + List loadRunners = Assembly.GetExecutingAssembly() + .GetTypes() + .Where(x => x.Namespace == "HeavenStudio.InputSystem.Loaders" && x.GetMethod("Initialize", BindingFlags.Public | BindingFlags.Static) != null) + .Select(t => (PlayerInput.InputControllerInitializer)Delegate.CreateDelegate( + typeof(PlayerInput.InputControllerInitializer), + null, + t.GetMethod("Initialize", BindingFlags.Public | BindingFlags.Static), + false + )) + .ToList(); + + // USG: static classes are IsAbstract is set. + if (!context.TargetClass.IsClass) + return false; // return false to tell USG doesn't write file. + + // USG: you can modify output path. default file name is that USG generated. + // note that USG doesn't care the modified path is valid or not. + //context.OutputPath += "_MyFirstTest.txt"; + + // USG: EditorUtility.DisplayDialog() or others don't work in batch mode. + // throw if method depending on GUI based functions. + //if (UnityEngine.Application.isBatchMode) + // throw new System.NotSupportedException("GUI based functions do nothing in batch mode."); + + // USG: write content into passed StringBuilder. + sb.Append($@" +using System; +using System.Linq; +using System.Reflection; + +using System.Collections.Generic; + +using HeavenStudio.InputSystem; +using HeavenStudio.InputSystem.Loaders; +using Debug = UnityEngine.Debug; + +namespace {context.TargetClass.Namespace} +{{ + partial class {context.TargetClass.Name} + {{ +"); + // class open ---------------------------------------------------------------------- + + + #region // USG: MainMember + sb.Append($@" + {MEMBER_ACCESS} int {MAIN_MEMBER_NAME}() + {{ +"); + sb.IndentLevel(3); + + sb.Append($@" + InputController[] controllers; + PlayerInputRefresh = new(); +"); + + foreach (var loadRunner in loadRunners) + { + MethodInfo methodInfo = RuntimeReflectionExtensions.GetMethodInfo(loadRunner); + string callingClass = methodInfo.DeclaringType.Name; + string method = methodInfo.Name; + string fullMethodLabel = $"{callingClass}.{method}"; + + sb.Append($@" + controllers = {fullMethodLabel}(); + if (controllers != null) + {{ + inputDevices.AddRange(controllers); + }} + else + {{ + Debug.Log(""{fullMethodLabel} had no controllers to initialize.""); + }} +"); + } + + sb.Append($@" + return inputDevices.Count; +"); + + // USG: semicolon? + sb.Append($@" + }} +"); + #endregion + + + // class close ---------------------------------------------------------------------- + sb.Append($@" + }} +}} +"); + + // USG: return true to tell USG to write content into OutputPath. false to do nothing. + return true; + } + +#pragma warning restore IDE0051 +#endif +} diff --git a/Assets/Scripts/SourceGenerators/ControllerLoaderGenerator.cs.meta b/Assets/Scripts/SourceGenerators/ControllerLoaderGenerator.cs.meta new file mode 100644 index 00000000..4c13f52c --- /dev/null +++ b/Assets/Scripts/SourceGenerators/ControllerLoaderGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 92162f67b41995a438008f78a72baba2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/MinigameLoaderGenerator.cs b/Assets/Scripts/SourceGenerators/MinigameLoaderGenerator.cs similarity index 95% rename from Assets/Scripts/MinigameLoaderGenerator.cs rename to Assets/Scripts/SourceGenerators/MinigameLoaderGenerator.cs index 364b646b..d6fcfc4a 100644 --- a/Assets/Scripts/MinigameLoaderGenerator.cs +++ b/Assets/Scripts/SourceGenerators/MinigameLoaderGenerator.cs @@ -53,13 +53,7 @@ public partial class MinigameLoaderGenerator // USG: write content into passed StringBuilder. sb.Append($@" -using System; -using System.Collections.Generic; -using UnityEngine; using Debug = UnityEngine.Debug; -using Object = UnityEngine.Object; - -using HeavenStudio; using HeavenStudio.Games.Loaders; namespace {context.TargetClass.Namespace} @@ -90,7 +84,7 @@ namespace {context.TargetClass.Namespace} sb.Append($@" Debug.Log(""Running game loader {callingClass}""); - game = {fullMethodLabel}(eventCaller); + game = {fullMethodLabel}(eventCaller); if (game != null) {{ eventCaller.minigames.Add(game.name, game); diff --git a/Assets/Scripts/MinigameLoaderGenerator.cs.meta b/Assets/Scripts/SourceGenerators/MinigameLoaderGenerator.cs.meta similarity index 100% rename from Assets/Scripts/MinigameLoaderGenerator.cs.meta rename to Assets/Scripts/SourceGenerators/MinigameLoaderGenerator.cs.meta diff --git a/Assets/Scripts/USG.g/LoadMinigames.Minigames.MinigameLoaderGenerator.g.cs b/Assets/Scripts/USG.g/LoadMinigames.Minigames.MinigameLoaderGenerator.g.cs index fc7f63fb..9023dcd2 100644 --- a/Assets/Scripts/USG.g/LoadMinigames.Minigames.MinigameLoaderGenerator.g.cs +++ b/Assets/Scripts/USG.g/LoadMinigames.Minigames.MinigameLoaderGenerator.g.cs @@ -1,12 +1,6 @@ // MinigameLoaderGenerator -using System; -using System.Collections.Generic; -using UnityEngine; using Debug = UnityEngine.Debug; -using Object = UnityEngine.Object; - -using HeavenStudio; using HeavenStudio.Games.Loaders; namespace HeavenStudio @@ -19,10 +13,8 @@ namespace HeavenStudio Minigames.Minigame game; - Debug.Log("Running game loader RvlBadmintonLoader"); - - game = RvlBadmintonLoader.AddGame(eventCaller); + game = RvlBadmintonLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -32,10 +24,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlBadmintonLoader failed!"); } - Debug.Log("Running game loader CtrBearLoader"); - - game = CtrBearLoader.AddGame(eventCaller); + game = CtrBearLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -45,10 +35,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader CtrBearLoader failed!"); } - Debug.Log("Running game loader RvlBoardMeetingLoader"); - - game = RvlBoardMeetingLoader.AddGame(eventCaller); + game = RvlBoardMeetingLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -58,10 +46,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlBoardMeetingLoader failed!"); } - Debug.Log("Running game loader NtrFlickLoader"); - - game = NtrFlickLoader.AddGame(eventCaller); + game = NtrFlickLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -71,10 +57,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrFlickLoader failed!"); } - Debug.Log("Running game loader CtrCatchLoader"); - - game = CtrCatchLoader.AddGame(eventCaller); + game = CtrCatchLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -84,10 +68,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader CtrCatchLoader failed!"); } - Debug.Log("Running game loader RvlBookLoader"); - - game = RvlBookLoader.AddGame(eventCaller); + game = RvlBookLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -97,10 +79,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlBookLoader failed!"); } - Debug.Log("Running game loader AgbClapLoader"); - - game = AgbClapLoader.AddGame(eventCaller); + game = AgbClapLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -110,10 +90,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbClapLoader failed!"); } - Debug.Log("Running game loader NtrCoinLoader"); - - game = NtrCoinLoader.AddGame(eventCaller); + game = NtrCoinLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -123,10 +101,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrCoinLoader failed!"); } - Debug.Log("Running game loader NtrCropLoader"); - - game = NtrCropLoader.AddGame(eventCaller); + game = NtrCropLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -136,10 +112,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrCropLoader failed!"); } - Debug.Log("Running game loader NtrDjLoader"); - - game = NtrDjLoader.AddGame(eventCaller); + game = NtrDjLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -149,10 +123,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrDjLoader failed!"); } - Debug.Log("Running game loader NtrDogNinjaLoader"); - - game = NtrDogNinjaLoader.AddGame(eventCaller); + game = NtrDogNinjaLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -162,10 +134,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrDogNinjaLoader failed!"); } - Debug.Log("Running game loader RvlDoubleDateLoader"); - - game = RvlDoubleDateLoader.AddGame(eventCaller); + game = RvlDoubleDateLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -175,10 +145,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlDoubleDateLoader failed!"); } - Debug.Log("Running game loader CtrDrummingLoader"); - - game = CtrDrummingLoader.AddGame(eventCaller); + game = CtrDrummingLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -188,10 +156,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader CtrDrummingLoader failed!"); } - Debug.Log("Running game loader NtrIdolLoader"); - - game = NtrIdolLoader.AddGame(eventCaller); + game = NtrIdolLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -201,10 +167,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrIdolLoader failed!"); } - Debug.Log("Running game loader AgbFireworkLoader"); - - game = AgbFireworkLoader.AddGame(eventCaller); + game = AgbFireworkLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -214,10 +178,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbFireworkLoader failed!"); } - Debug.Log("Running game loader CtrFirstContact"); - - game = CtrFirstContact.AddGame(eventCaller); + game = CtrFirstContact.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -227,10 +189,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader CtrFirstContact failed!"); } - Debug.Log("Running game loader RvlFlipperFlopLoader"); - - game = RvlFlipperFlopLoader.AddGame(eventCaller); + game = RvlFlipperFlopLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -240,10 +200,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlFlipperFlopLoader failed!"); } - Debug.Log("Running game loader RvlForkLoader"); - - game = RvlForkLoader.AddGame(eventCaller); + game = RvlForkLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -253,10 +211,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlForkLoader failed!"); } - Debug.Log("Running game loader NtrGleeClubLoader"); - - game = NtrGleeClubLoader.AddGame(eventCaller); + game = NtrGleeClubLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -266,10 +222,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrGleeClubLoader failed!"); } - Debug.Log("Running game loader RvlNewKarateLoader"); - - game = RvlNewKarateLoader.AddGame(eventCaller); + game = RvlNewKarateLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -279,10 +233,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlNewKarateLoader failed!"); } - Debug.Log("Running game loader CtrTeppanLoader"); - - game = CtrTeppanLoader.AddGame(eventCaller); + game = CtrTeppanLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -292,10 +244,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader CtrTeppanLoader failed!"); } - Debug.Log("Running game loader RvlRocketLoader"); - - game = RvlRocketLoader.AddGame(eventCaller); + game = RvlRocketLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -305,10 +255,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlRocketLoader failed!"); } - Debug.Log("Running game loader NtrBackbeatLoader"); - - game = NtrBackbeatLoader.AddGame(eventCaller); + game = NtrBackbeatLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -318,10 +266,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrBackbeatLoader failed!"); } - Debug.Log("Running game loader AgbMarcherLoader"); - - game = AgbMarcherLoader.AddGame(eventCaller); + game = AgbMarcherLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -331,10 +277,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbMarcherLoader failed!"); } - Debug.Log("Running game loader PcoMeatLoader"); - - game = PcoMeatLoader.AddGame(eventCaller); + game = PcoMeatLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -344,10 +288,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader PcoMeatLoader failed!"); } - Debug.Log("Running game loader AgbUpbeatLoader"); - - game = AgbUpbeatLoader.AddGame(eventCaller); + game = AgbUpbeatLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -357,10 +299,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbUpbeatLoader failed!"); } - Debug.Log("Running game loader ntrMunchyMonkLoader"); - - game = ntrMunchyMonkLoader.AddGame(eventCaller); + game = ntrMunchyMonkLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -370,10 +310,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader ntrMunchyMonkLoader failed!"); } - Debug.Log("Running game loader NtrOctopusMachineLoader"); - - game = NtrOctopusMachineLoader.AddGame(eventCaller); + game = NtrOctopusMachineLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -383,10 +321,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrOctopusMachineLoader failed!"); } - Debug.Log("Running game loader CtrPillowLoader"); - - game = CtrPillowLoader.AddGame(eventCaller); + game = CtrPillowLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -396,10 +332,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader CtrPillowLoader failed!"); } - Debug.Log("Running game loader AgbQuizShowLoader"); - - game = AgbQuizShowLoader.AddGame(eventCaller); + game = AgbQuizShowLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -409,10 +343,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbQuizShowLoader failed!"); } - Debug.Log("Running game loader NtrPingpongLoader"); - - game = NtrPingpongLoader.AddGame(eventCaller); + game = NtrPingpongLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -422,10 +354,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrPingpongLoader failed!"); } - Debug.Log("Running game loader PcoSomenLoader"); - - game = PcoSomenLoader.AddGame(eventCaller); + game = PcoSomenLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -435,10 +365,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader PcoSomenLoader failed!"); } - Debug.Log("Running game loader AgbHairLoader"); - - game = AgbHairLoader.AddGame(eventCaller); + game = AgbHairLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -448,10 +376,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbHairLoader failed!"); } - Debug.Log("Running game loader RvlRingsideLoader"); - - game = RvlRingsideLoader.AddGame(eventCaller); + game = RvlRingsideLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -461,10 +387,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlRingsideLoader failed!"); } - Debug.Log("Running game loader NtrRockersLoader"); - - game = NtrRockersLoader.AddGame(eventCaller); + game = NtrRockersLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -474,10 +398,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrRockersLoader failed!"); } - Debug.Log("Running game loader NtrSamuraiLoader"); - - game = NtrSamuraiLoader.AddGame(eventCaller); + game = NtrSamuraiLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -487,10 +409,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrSamuraiLoader failed!"); } - Debug.Log("Running game loader RvlSeeSawLoader"); - - game = RvlSeeSawLoader.AddGame(eventCaller); + game = RvlSeeSawLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -500,10 +420,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlSeeSawLoader failed!"); } - Debug.Log("Running game loader AgbGhostLoader"); - - game = AgbGhostLoader.AddGame(eventCaller); + game = AgbGhostLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -513,10 +431,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbGhostLoader failed!"); } - Debug.Log("Running game loader AgbBatterLoader"); - - game = AgbBatterLoader.AddGame(eventCaller); + game = AgbBatterLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -526,10 +442,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbBatterLoader failed!"); } - Debug.Log("Running game loader AgbSpaceDanceLoader"); - - game = AgbSpaceDanceLoader.AddGame(eventCaller); + game = AgbSpaceDanceLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -539,10 +453,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbSpaceDanceLoader failed!"); } - Debug.Log("Running game loader NtrSoccerLoader"); - - game = NtrSoccerLoader.AddGame(eventCaller); + game = NtrSoccerLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -552,10 +464,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrSoccerLoader failed!"); } - Debug.Log("Running game loader NtrSplashdownLoader"); - - game = NtrSplashdownLoader.AddGame(eventCaller); + game = NtrSplashdownLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -565,10 +475,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrSplashdownLoader failed!"); } - Debug.Log("Running game loader RvlTambourineLoader"); - - game = RvlTambourineLoader.AddGame(eventCaller); + game = RvlTambourineLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -578,10 +486,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlTambourineLoader failed!"); } - Debug.Log("Running game loader AgbTapLoader"); - - game = AgbTapLoader.AddGame(eventCaller); + game = AgbTapLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -591,10 +497,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbTapLoader failed!"); } - Debug.Log("Running game loader RvlTapTroupeLoader"); - - game = RvlTapTroupeLoader.AddGame(eventCaller); + game = RvlTapTroupeLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -604,10 +508,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader RvlTapTroupeLoader failed!"); } - Debug.Log("Running game loader NtrDazzlesLoader"); - - game = NtrDazzlesLoader.AddGame(eventCaller); + game = NtrDazzlesLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -617,10 +519,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrDazzlesLoader failed!"); } - Debug.Log("Running game loader AgbTossBoysLoader"); - - game = AgbTossBoysLoader.AddGame(eventCaller); + game = AgbTossBoysLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -630,10 +530,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbTossBoysLoader failed!"); } - Debug.Log("Running game loader AgbTramLoader"); - - game = AgbTramLoader.AddGame(eventCaller); + game = AgbTramLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -643,10 +541,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbTramLoader failed!"); } - Debug.Log("Running game loader MobTrickLoader"); - - game = MobTrickLoader.AddGame(eventCaller); + game = MobTrickLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -656,10 +552,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader MobTrickLoader failed!"); } - Debug.Log("Running game loader NtrTunnelLoader"); - - game = NtrTunnelLoader.AddGame(eventCaller); + game = NtrTunnelLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -669,10 +563,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader NtrTunnelLoader failed!"); } - Debug.Log("Running game loader AgbWaltzLoader"); - - game = AgbWaltzLoader.AddGame(eventCaller); + game = AgbWaltzLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); @@ -682,10 +574,8 @@ namespace HeavenStudio Debug.LogWarning("Game loader AgbWaltzLoader failed!"); } - Debug.Log("Running game loader RvlWorkingDoughLoader"); - - game = RvlWorkingDoughLoader.AddGame(eventCaller); + game = RvlWorkingDoughLoader.AddGame(eventCaller); if (game != null) { eventCaller.minigames.Add(game.name, game); diff --git a/ProjectSettings/SatorImaging.UnitySourceGenerator.Editor.ProjectSettingsData.asset b/ProjectSettings/SatorImaging.UnitySourceGenerator.Editor.ProjectSettingsData.asset index 309797c9..430138a6 100644 --- a/ProjectSettings/SatorImaging.UnitySourceGenerator.Editor.ProjectSettingsData.asset +++ b/ProjectSettings/SatorImaging.UnitySourceGenerator.Editor.ProjectSettingsData.asset @@ -13,9 +13,16 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: AutoEmitOnScriptUpdate: 1 - AutoEmitDisabledPaths: [] + AutoEmitDisabledPaths: + - Assets/Scripts/SourceGenerators/ControllerLoaderGenerator.cs DenseViewWidthThreshold: 512 _disableAutoReloadInBackground: 0 - ImportedScriptPaths: [] + ImportedScriptPaths: + - Assets/Scripts/InputSystem/PlayerInput.cs + - Assets/Scripts/SourceGenerators/ControllerLoaderGenerator.cs + - Assets/Scripts/SourceGenerators/MinigameLoaderGenerator.cs + - Assets/Scripts/GlobalGameManager.cs + - Assets/Scripts/InputSystem/InputController.cs + - Assets/Scripts/Minigames.cs PathsToSkipImportEvent: [] PathsToIgnoreOverwriteSettingOnAttribute: []