gg.easy.airship 0.1.2173 → 0.1.2176

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/Editor/EditorIntegrationsConfig.cs +2 -0
  2. package/Editor/GameConfig/GameConfigEditor.cs +1 -0
  3. package/Editor/Publish/Deploy.cs +59 -8
  4. package/Editor/Settings/AirshipScriptingSettingsProvider.cs +1 -1
  5. package/Editor/TypescriptCompiler~/utsc.js +155 -155
  6. package/Editor/TypescriptServices/Compiler/TypescriptCompilationService.cs +5 -13
  7. package/Editor/TypescriptServices/Compiler/TypescriptCompilerBuildArguments.cs +16 -6
  8. package/Editor/TypescriptServices/Editor/TerminalFormatting.cs +11 -1
  9. package/Editor/TypescriptServices/Editor/TypescriptLogService.cs +10 -6
  10. package/Editor/TypescriptServices/Editor/TypescriptOptions.cs +15 -0
  11. package/Editor/TypescriptServices/Projects/TypescriptProjectsService.cs +43 -0
  12. package/Runtime/Code/Agones/AgonesProxy.cs +7 -0
  13. package/Runtime/Code/Airship/Resources/Scripts/MaterialColorURP.cs +8 -5
  14. package/Runtime/Code/Bootstrap/ClientBundleLoader.cs +34 -22
  15. package/Runtime/Code/Bundles/AirshipRuntimePath.cs +20 -0
  16. package/Runtime/Code/Bundles/AirshipRuntimePath.cs.meta +3 -0
  17. package/Runtime/Code/Bundles/AssetBridge.cs +13 -1
  18. package/Runtime/Code/Bundles/SystemRoot.cs +75 -10
  19. package/Runtime/Code/DeveloperTooling/EasyGridAlign.cs +29 -16
  20. package/Runtime/Code/DeveloperTooling/EasyLookAt.cs +43 -8
  21. package/Runtime/Code/DeveloperTooling/EasyMotion.cs +11 -3
  22. package/Runtime/Code/DeveloperTooling/EasyToolingData.cs +7 -0
  23. package/Runtime/Code/GameConfig/GameConfig.cs +1 -1
  24. package/Runtime/Code/Player/Character/Animation/CharacterAnimationHelper.cs +6 -4
  25. package/Runtime/Code/TSCodeGen/TypeGenerator.cs +9 -3
  26. package/package.json +1 -1
@@ -32,6 +32,8 @@ public class EditorIntegrationsConfig : ScriptableSingleton<EditorIntegrationsCo
32
32
  [SerializeField] public bool enableMainMenu = false;
33
33
 
34
34
  [SerializeField] public bool buildWithoutUpload = false;
35
+
36
+ [SerializeField] public bool codeSplitting = true;
35
37
 
36
38
  [SerializeField]
37
39
  public bool manageTypescriptProject = false;
@@ -56,6 +56,7 @@ public class GameConfigEditor : UnityEditor.Editor {
56
56
  EditorGUILayout.PropertyField(this.compileURPShaders, new GUIContent("Compile URP Shaders") {
57
57
  tooltip = "By default, your game will use a precompiled set of URP shaders for basic usage. Checking this box will compile URP shaders specifically for your game. If you have any advanced URP materials (or notice invisible materials on published games), you should check this box."
58
58
  });
59
+
59
60
  GUILayout.Space(20);
60
61
 
61
62
  foreach (var field in typeof(GameConfig).GetFields()) {
@@ -125,18 +125,44 @@ public class Deploy {
125
125
  // Rebuild Typescript
126
126
  var shouldRecompile = !skipBuild;
127
127
  var shouldResumeTypescriptWatch = shouldRecompile && TypescriptCompilationService.IsWatchModeRunning;
128
+ var useSplitCodeBundle = EditorIntegrationsConfig.instance.codeSplitting;
129
+
130
+ if (!useSplitCodeBundle) {
131
+ var result = EditorUtility.DisplayDialogComplex("Code stripping is disabled",
132
+ "You are about to publish with code stripping disabled, are you sure you want to continue?\n\nThis will make any server code available to the client.", "Continue",
133
+ "Enable", "Cancel");
134
+
135
+ if (result == 1) {
136
+ EditorIntegrationsConfig.instance.codeSplitting = true;
137
+ useSplitCodeBundle = true;
138
+ } else if (result == 2) {
139
+ yield break;
140
+ }
141
+ }
128
142
 
129
143
  // We want to do a full publish
130
-
131
144
  if (shouldRecompile) {
132
- TypescriptCompilationService.StopCompilers();
145
+ var compileFlags = TypeScriptCompileFlags.DisplayProgressBar; // FullClean will clear the incremental file
146
+
147
+ // Compiler doesn't need to be stopped if it's a split code bundle, since that's compiled to the dist folder
148
+ // The publish flag here will enable all the fancy features around this
149
+ if (useSplitCodeBundle) {
150
+ compileFlags |= TypeScriptCompileFlags.Publishing;
151
+ } else {
152
+ TypescriptCompilationService.StopCompilers();
153
+ }
133
154
 
134
- var compileFlags = TypeScriptCompileFlags.Publishing | TypeScriptCompileFlags.DisplayProgressBar; // FullClean will clear the incremental file & Publishing will omit editor data
135
-
136
155
  if (skipBuild) {
137
156
  compileFlags |= TypeScriptCompileFlags.SkipReimportQueue; // code publish does not require asset reimport
138
157
  }
139
158
 
159
+ TypescriptCompilationService.BuildTypescript(compileFlags);
160
+ } else if (useSplitCodeBundle) {
161
+ var compileFlags = TypeScriptCompileFlags.Publishing
162
+ | TypeScriptCompileFlags.DisplayProgressBar
163
+ | TypeScriptCompileFlags.SkipPackages
164
+ | TypeScriptCompileFlags.SkipReimportQueue; // skipping packages in the bg
165
+
140
166
  TypescriptCompilationService.BuildTypescript(compileFlags);
141
167
  }
142
168
 
@@ -228,7 +254,7 @@ public class Deploy {
228
254
  codeZip.AddEntry(path, File.ReadAllBytes(path));
229
255
  continue;
230
256
  }
231
-
257
+
232
258
  // GetOutputPath is case sensitive so hacky workaround is to make our path start with capital "A"
233
259
  var luaOutPath = TypescriptProjectsService.Project.GetOutputPath(path.Replace("assets/", "Assets/"));
234
260
  if (!File.Exists(luaOutPath)) {
@@ -238,9 +264,34 @@ public class Deploy {
238
264
 
239
265
  // We want a .lua in the same spot the .ts would be
240
266
  var luaFakePath = path.Replace(".ts", ".lua");
241
- var bytes = File.ReadAllBytes(luaOutPath);
242
- codeZip.AddEntry(luaFakePath, bytes);
243
-
267
+
268
+ if (useSplitCodeBundle) {
269
+ var serverPath = TypescriptProjectsService.GetPublishingContextPath(luaOutPath,
270
+ TypescriptProjectsService.DeploymentContext.Server);
271
+ var clientPath = TypescriptProjectsService.GetPublishingContextPath(luaOutPath,
272
+ TypescriptProjectsService.DeploymentContext.Client);
273
+
274
+ if (File.Exists(serverPath) && File.Exists(clientPath)) {
275
+ var serverBytes = File.ReadAllBytes(serverPath);
276
+ var serverFakePath = path.Replace(".ts", AirshipRuntimePath.ServerExtension);
277
+ codeZip.AddEntry(serverFakePath, serverBytes);
278
+
279
+ var clientBytes = File.ReadAllBytes(clientPath);
280
+ var clientFakePath = path.Replace(".ts", AirshipRuntimePath.ClientExtension);
281
+ codeZip.AddEntry(clientFakePath, clientBytes);
282
+ } else {
283
+ var sharedPath = TypescriptProjectsService.GetPublishingContextPath(luaOutPath,
284
+ TypescriptProjectsService.DeploymentContext.Shared);
285
+
286
+ var sharedBytes = File.ReadAllBytes(sharedPath);
287
+ var sharedFakePath = path.Replace(".ts", AirshipRuntimePath.LuaExtension);
288
+ codeZip.AddEntry(sharedFakePath, sharedBytes);
289
+ }
290
+ } else {
291
+ var bytes = File.ReadAllBytes(luaOutPath);
292
+ codeZip.AddEntry(luaFakePath, bytes);
293
+ }
294
+
244
295
  var jsonPath = luaOutPath + ".json~";
245
296
  if (File.Exists(jsonPath)) {
246
297
  // var jsonBytes = File.ReadAllBytes(jsonPath);
@@ -19,7 +19,7 @@ namespace Editor.Settings {
19
19
  {
20
20
  var provider = new AirshipScriptingSettingsProvider(Path) {
21
21
  keywords = new[] { "Github", "Airship", "Typescript", "Compiler", "Scripting", "Scripts", "Compiling" },
22
- label = "TypeScript Services",
22
+ label = "TypeScript Settings",
23
23
  };
24
24
  return provider;
25
25
  }