gg.easy.airship 0.1.2135 → 0.1.2136

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.
@@ -0,0 +1,36 @@
1
+ using Mirror;
2
+ using UnityEditor;
3
+ using UnityEngine;
4
+
5
+ namespace Airship.Editor {
6
+ internal static class AirshipPrefabUtility {
7
+ internal static bool FindReconcilablePrefabComponent(AirshipComponent component, out AirshipComponent prefabComponent) {
8
+ var isPrefab = PrefabUtility.IsPartOfAnyPrefab(component);
9
+ prefabComponent = PrefabUtility.GetCorrespondingObjectFromOriginalSource(component);
10
+
11
+ if (!isPrefab) {
12
+ prefabComponent = null;
13
+ return false;
14
+ }
15
+
16
+ if (prefabComponent.script == null) {
17
+ prefabComponent = null;
18
+ return false;
19
+ }
20
+
21
+ var networkIdentity = prefabComponent.gameObject.GetComponentInParent<NetworkIdentity>();
22
+ if (networkIdentity != null) {
23
+ prefabComponent = null;
24
+ return false;
25
+ }
26
+
27
+ var meshFilter = prefabComponent.GetComponentsInChildren<MeshFilter>(); // because of 'SendMessage' we can't force reconcile these
28
+ if (meshFilter.Length > 0) {
29
+ prefabComponent = null;
30
+ return false;
31
+ }
32
+
33
+ return true;
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,3 @@
1
+ fileFormatVersion: 2
2
+ guid: 49673f97bd5f43a184a49c4379fb4786
3
+ timeCreated: 1748391009
@@ -5,6 +5,7 @@ using System.Collections.Generic;
5
5
  using System.Linq;
6
6
  using Editor.EditorInternal;
7
7
  using Luau;
8
+ using Mirror;
8
9
  using Mirror.SimpleWeb;
9
10
  using Newtonsoft.Json;
10
11
  using UnityEditor;
@@ -251,7 +252,7 @@ namespace Airship.Editor {
251
252
  status = ReconcileStatus.Unsuccessful;
252
253
  return false;
253
254
  }
254
-
255
+
255
256
  var artifactData = AirshipLocalArtifactDatabase.instance;
256
257
 
257
258
  // Ensure we have the script asset data first, if not we'll just have to queue it for the compiler to process...
@@ -334,10 +335,7 @@ namespace Airship.Editor {
334
335
 
335
336
  if (ReconcilerVersion == ReconcilerVersion.Version2) {
336
337
  var component = eventData.Component;
337
-
338
- var isPrefab = PrefabUtility.IsPartOfAnyPrefab(component);
339
- var prefabOriginalComponent = PrefabUtility.GetCorrespondingObjectFromOriginalSource(component);
340
- if (isPrefab && prefabOriginalComponent.script != null) {
338
+ if (AirshipPrefabUtility.FindReconcilablePrefabComponent(component, out var prefabOriginalComponent)) {
341
339
  // If it's a instance component:
342
340
  // - We need to reconcile the source component first:
343
341
  // - If successful: We can then reconcile the instance
@@ -365,6 +363,9 @@ namespace Airship.Editor {
365
363
  break;
366
364
  }
367
365
  }
366
+
367
+
368
+
368
369
  }
369
370
  else {
370
371
  // It's just an orphaned instance, or we're reconciling the original component, we can just reconcile it outright. No silly business required.
@@ -372,6 +373,7 @@ namespace Airship.Editor {
372
373
  }
373
374
  }
374
375
  else {
376
+
375
377
  var component = eventData.Component;
376
378
  ReconcileComponent(component);
377
379
  //component.componentHash = component.scriptHash;
@@ -57,7 +57,7 @@ using Object = UnityEngine.Object;
57
57
  // [InitializeOnLoad]
58
58
  public static class TypescriptCompilationService {
59
59
  private const int ExitCodeKill = 137;
60
- private const string TsCompilerService = "Typescript Compilation Service";
60
+ private const string TsCompilerService = "Compiling Scripts";
61
61
 
62
62
  /// <summary>
63
63
  /// True if the compiler is running in watch mode
@@ -389,7 +389,7 @@ using Object = UnityEngine.Object;
389
389
  try
390
390
  {
391
391
  if (fullClean) {
392
- UpdateCompilerProgressBarText($"Install packages for '{packageInfo.Name}'...");
392
+ UpdateCompilerProgressBarText($"Preparing TypeScript project");
393
393
  var success = RunNpmInstall(packageDir);
394
394
  if (!success)
395
395
  {
@@ -407,7 +407,7 @@ using Object = UnityEngine.Object;
407
407
  while (!compilerProcess.HasExited) {
408
408
  if (compilationState.FilesToCompileCount == 0) continue;
409
409
  UpdateCompilerProgressBar(
410
- compilationState.CompiledFileCount / (float)compilationState.FilesToCompileCount, $"Compiling {compilationState.CompiledFileCount}/{project.CompilationState.FilesToCompileCount}");
410
+ compilationState.CompiledFileCount / (float)compilationState.FilesToCompileCount, $"Compiling TypeScript files {compilationState.CompiledFileCount}/{project.CompilationState.FilesToCompileCount}...");
411
411
  }
412
412
 
413
413
  // compilerProcess.WaitForExit();
@@ -64,6 +64,12 @@ namespace Airship.Editor {
64
64
  Debug.LogWarning("[TypescriptServices] Skipped, in Airship Player mode");
65
65
  return;
66
66
  #endif
67
+ // On project load we'll force a full compile to try and get all the refs up to date
68
+ if (!SessionState.GetBool("TypescriptInitialBoot", false)) {
69
+ SessionState.SetBool("TypescriptInitialBoot", true);
70
+ TypescriptCompilationService.BuildTypescript(TypeScriptCompileFlags.FullClean | TypeScriptCompileFlags.Setup | TypeScriptCompileFlags.DisplayProgressBar);
71
+ }
72
+
67
73
  // If a server or clone - ignore
68
74
  if (!IsValidEditor) return;
69
75
  EditorApplication.delayCall += OnLoadDeferred;
@@ -10,7 +10,7 @@ using Unity.Multiplayer.Playmode;
10
10
  [LuauAPI]
11
11
  public class RunCore {
12
12
  // Launch params
13
- public static bool launchInDedicatedServerMode = true;
13
+ public static bool launchInDedicatedServerMode = false;
14
14
 
15
15
  private static bool isServer = false;
16
16
  private static bool isClient = false;