gg.easy.airship 0.1.2104 → 0.1.2106

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 (95) hide show
  1. package/Editor/Accessories/AccessoryEditorWindow.cs +38 -29
  2. package/Editor/Accessories/Clothing/PlatformGearBundleManifestEditor.cs +11 -2
  3. package/Editor/AirAsset/AirAssetBundleEditor.cs +2 -2
  4. package/Editor/AirshipComponentEditor.cs +33 -28
  5. package/Editor/AirshipComponents/AirshipComponentHeaderHandler.cs +1 -2
  6. package/Editor/AirshipComponents/AirshipComponentHeaderWrapper.cs +7 -9
  7. package/Editor/AirshipScriptGUI.cs +8 -5
  8. package/Editor/BinaryFileDragDrop.cs +38 -70
  9. package/Editor/EditorIntegrationsConfig.cs +1 -1
  10. package/Editor/EditorInternal/EditorGUIExtensions.cs +5 -0
  11. package/Editor/EditorInternal/EditorGUIExtensions.cs.meta +3 -0
  12. package/Editor/LuauImporter.cs +1 -1
  13. package/Editor/Publish/Deploy.cs +16 -5
  14. package/Editor/TypescriptCompiler~/utsc.js +140 -140
  15. package/Editor/TypescriptServices/Compiler/TypescriptCompilationService.cs +97 -42
  16. package/Editor/TypescriptServices/Editor/AirshipComponentButton.cs +4 -3
  17. package/Editor/TypescriptServices/Editor/AirshipScriptFileEditor.cs +8 -8
  18. package/Editor/TypescriptServices/Editor/TypescriptOptions.cs +110 -59
  19. package/Editor/TypescriptServices/Projects/TypescriptProject.cs +2 -0
  20. package/Editor/TypescriptServices/Projects/TypescriptProjectsService.cs +2 -1
  21. package/Editor/TypescriptServices/TypescriptServices.cs +1 -0
  22. package/Editor/Util/AirshipEditorGUI.cs +87 -0
  23. package/Runtime/Code/Agones/AutoShutdownBridge.cs +1 -1
  24. package/Runtime/Code/AirAssetBundle/AirAssetBundle.cs +9 -5
  25. package/Runtime/Code/Bootstrap/SignalHandler.cs +28 -31
  26. package/Runtime/Code/Bundles/AirshipEditorNetworkConfig.cs.meta +9 -1
  27. package/Runtime/Code/Luau/AirshipComponent.cs +383 -844
  28. package/Runtime/Code/Luau/AirshipComponentV2.cs +360 -0
  29. package/Runtime/Code/Luau/AirshipComponentV2.cs.meta +3 -0
  30. package/Runtime/Code/Luau/Editor/LuauCoreEditor.cs +30 -0
  31. package/Runtime/Code/Luau/Editor/LuauCoreEditor.cs.meta +3 -0
  32. package/Runtime/Code/Luau/LuauCompiler.cs +1 -1
  33. package/Runtime/Code/Luau/LuauCore.cs +19 -64
  34. package/Runtime/Code/Luau/LuauCore.cs.meta +11 -11
  35. package/Runtime/Code/Luau/LuauCoreCallbacks.cs +72 -89
  36. package/Runtime/Code/Luau/LuauCoreSystemNamespaces.cs +4 -1
  37. package/Runtime/Code/Luau/LuauCoreUtilities.cs +3 -26
  38. package/Runtime/Code/Luau/LuauMetadata.cs +12 -13
  39. package/Runtime/Code/Luau/LuauPlugin.cs +16 -4
  40. package/Runtime/Code/Luau/LuauPluginRaw.cs +17 -17
  41. package/Runtime/Code/Luau/LuauScript.cs +191 -0
  42. package/Runtime/Code/Luau/LuauScript.cs.meta +3 -0
  43. package/Runtime/Code/Luau/LuauState.cs +8 -3
  44. package/Runtime/Code/Luau/ScriptingEntryPoint.cs +13 -21
  45. package/Runtime/Code/LuauAPI/AirshipBehaviourHelper.cs +34 -42
  46. package/Runtime/Code/LuauAPI/Bridge.cs +7 -0
  47. package/Runtime/Code/LuauHelper/AssetBridgeInjector.cs +3 -4
  48. package/Runtime/Code/LuauHelper/LuauHelper.cs +2 -1
  49. package/Runtime/Code/LuauHelper/LuauHelper.cs.meta +9 -1
  50. package/Runtime/Code/MainMenu/MainMenuSceneManager.cs +3 -5
  51. package/Runtime/Code/Misc/AirshipBuildInfo.cs +1 -1
  52. package/Runtime/Code/Network/AirshipNetworkManager.cs +4 -5
  53. package/Runtime/Code/Platform/Shared/AirshipInventoryServiceDto.cs +7 -0
  54. package/Runtime/Code/Player/Accessories/AccessoryBuilder.cs +2 -8
  55. package/Runtime/Code/Player/Accessories/AccessoryComponent.cs +7 -0
  56. package/Runtime/Code/Player/Character/Animation/CharacterAnimationHelper.cs +5 -5
  57. package/Runtime/Code/Player/OcclusionCam.cs +59 -54
  58. package/Runtime/Code/TSCodeGen/TypeGenerator.cs +2 -0
  59. package/Runtime/Code/UserInput/InputBridge.cs.meta +11 -11
  60. package/Runtime/Code/VoxelWorld/VoxelBlockDefinitionList.cs +37 -11
  61. package/Runtime/Plugins/Linux/libLuauPlugin.so +0 -0
  62. package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/Info.plist +1 -1
  63. package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/{MacOS/LuauPlugin.meta → Info.plist.meta} +1 -1
  64. package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/MacOS/LuauPlugin +0 -0
  65. package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/MacOS.meta +8 -0
  66. package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/_CodeSignature/CodeResources.meta +7 -0
  67. package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/_CodeSignature.meta +8 -0
  68. package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents.meta +8 -0
  69. package/Runtime/Plugins/Windows/x64/LuauPlugin.dll +0 -0
  70. package/Runtime/Plugins/Windows/x64/LuauPlugin.dll.meta +1 -62
  71. package/Runtime/Plugins/Windows/x64/LuauPlugin.pdb +0 -0
  72. package/Runtime/Plugins/iOS/LuauPluginIos.a +0 -0
  73. package/Runtime/Prefabs/LuauCore.prefab +104 -0
  74. package/{Editor/Resources/HumanAnimationPrefab.prefab.meta → Runtime/Prefabs/LuauCore.prefab.meta} +1 -1
  75. package/Runtime/Scenes/CoreScene.unity +231 -263
  76. package/Runtime/Scenes/MainMenu.unity +146 -66
  77. package/ThirdParty/UnityTweens/Runtime/AirshipTweenExtensions.cs +11 -0
  78. package/URP/AirshipURPAsset_Renderer.asset +34 -37
  79. package/URP/Shaders/AirshipCharacterAlpha.shader +95 -0
  80. package/URP/Shaders/AirshipCharacterAlpha.shader.meta +9 -0
  81. package/URP/Shaders/AirshipCharacterBehindWalls.shader +59 -0
  82. package/URP/Shaders/AirshipCharacterBehindWalls.shader.meta +9 -0
  83. package/URP/Shaders/AirshipCharacterStencil.shader +19 -0
  84. package/URP/Shaders/AirshipCharacterStencil.shader.meta +9 -0
  85. package/URP/Shaders/CharacterOverlayAlpha.mat +167 -0
  86. package/URP/Shaders/CharacterOverlayAlpha.mat.meta +8 -0
  87. package/URP/Shaders/CharacterOverlayBehindWalls.mat +167 -0
  88. package/URP/Shaders/CharacterOverlayBehindWalls.mat.meta +8 -0
  89. package/URP/Shaders/CharacterOverlayStencil.mat +167 -0
  90. package/URP/Shaders/CharacterOverlayStencil.mat.meta +8 -0
  91. package/URP/Shaders.meta +8 -0
  92. package/package.json +1 -1
  93. package/Editor/Resources/HumanAnimationPrefab.prefab +0 -23574
  94. package/Runtime/Code/Luau/AirshipComponentUpdater.cs +0 -59
  95. package/Runtime/Code/Luau/AirshipComponentUpdater.cs.meta +0 -3
@@ -34,8 +34,8 @@ namespace Editor.Accessories {
34
34
  private AccessoryPrefabEditor prefabEditor;
35
35
  private GameObject characterGO;
36
36
  List<AccessoryComponent> allAccessories = new List<AccessoryComponent>();
37
- private AccessoryComponent _editingAccessoryComponent;
38
- private AccessoryComponent _referenceAccessoryComponent;
37
+ private AccessoryComponent editingAccessoryComponent;
38
+ private AccessoryComponent referenceAccessoryComponent;
39
39
  private ListView _listPane;
40
40
 
41
41
  private Label _selectedItemLabel;
@@ -46,7 +46,7 @@ namespace Editor.Accessories {
46
46
 
47
47
  private static void Log(string message){
48
48
  #if AIRSHIP_INTERNAL
49
- Debug.Log("AccEditor: " + message);
49
+ // Debug.Log("AccEditor: " + message);
50
50
  #endif
51
51
  }
52
52
 
@@ -57,8 +57,8 @@ namespace Editor.Accessories {
57
57
  }
58
58
 
59
59
  _prefabStage = null;
60
- _editingAccessoryComponent = null;
61
- _referenceAccessoryComponent = null;
60
+ editingAccessoryComponent = null;
61
+ referenceAccessoryComponent = null;
62
62
 
63
63
  if (characterGO) {
64
64
  DestroyImmediate(characterGO);
@@ -130,7 +130,7 @@ namespace Editor.Accessories {
130
130
  saveBtn.text = "Save";
131
131
  buttonPanel.Add(saveBtn);
132
132
  saveBtn.clickable.clicked += () => {
133
- if (_editingAccessoryComponent == null || _referenceAccessoryComponent == null) return;
133
+ if (editingAccessoryComponent == null || referenceAccessoryComponent == null) return;
134
134
  SaveCurrentAccessory();
135
135
  };
136
136
 
@@ -139,7 +139,7 @@ namespace Editor.Accessories {
139
139
  resetBtn.text = "Reset";
140
140
  buttonPanel.Add(resetBtn);
141
141
  resetBtn.clickable.clicked += () => {
142
- if (_editingAccessoryComponent == null || _referenceAccessoryComponent == null) return;
142
+ if (editingAccessoryComponent == null || referenceAccessoryComponent == null) return;
143
143
  ResetCurrentAccessory();
144
144
  };
145
145
 
@@ -219,9 +219,9 @@ namespace Editor.Accessories {
219
219
 
220
220
  private void ClearCurrentAccessory() {
221
221
  Log("ClearCurrentAccessory");
222
- if (_editingAccessoryComponent) {
223
- DestroyImmediate(_editingAccessoryComponent.gameObject);
224
- _editingAccessoryComponent = null;
222
+ if (editingAccessoryComponent) {
223
+ DestroyImmediate(editingAccessoryComponent.gameObject);
224
+ editingAccessoryComponent = null;
225
225
  }
226
226
 
227
227
  if (_selectedItemLabel != null) {
@@ -229,9 +229,11 @@ namespace Editor.Accessories {
229
229
  }
230
230
  }
231
231
 
232
+
233
+ private bool hasFramedView = false;
232
234
  private void BuildScene(AccessoryComponent accessoryComponent, bool forceRedraw = false) {
233
- var newItem = accessoryComponent != _referenceAccessoryComponent;
234
- Log("Building Scene. New Item: " + newItem + " acc: " + accessoryComponent?.gameObject.name + " oldAcc: " + _referenceAccessoryComponent?.gameObject.name);
235
+ var newItem = accessoryComponent != referenceAccessoryComponent;
236
+ Log("Building Scene. New Item: " + newItem + " acc: " + accessoryComponent?.gameObject.name + " oldAcc: " + referenceAccessoryComponent?.gameObject.name);
235
237
  if (_prefabStage == null || characterGO == null) {
236
238
  CreateStage();
237
239
  }
@@ -252,17 +254,24 @@ namespace Editor.Accessories {
252
254
  return;
253
255
  }
254
256
 
255
-
256
257
  var go = (GameObject)PrefabUtility.InstantiatePrefab(accessoryComponent.gameObject, parent);
257
258
  if (go != null) {
258
- _editingAccessoryComponent = go.GetComponent<AccessoryComponent>();
259
- _referenceAccessoryComponent = accessoryComponent;
259
+ this.editingAccessoryComponent = go.GetComponent<AccessoryComponent>();
260
+ this.referenceAccessoryComponent = accessoryComponent;
260
261
  //accessoryComponent.gameObject.hideFlags = HideFlags.DontSave;
261
262
  Selection.activeObject = go;
262
263
  Selection.activeGameObject = go;
263
- SceneView.FrameLastActiveSceneView();
264
+ // SceneView.FrameLastActiveSceneView();
264
265
 
265
266
  _selectedItemLabel.text = accessoryComponent.name;
267
+
268
+ if (this.editingAccessoryComponent.skinnedToCharacter) {
269
+ var skinnedMeshRenderers = go.GetComponentsInChildren<SkinnedMeshRenderer>();
270
+ foreach (var skinnedMeshRenderer in skinnedMeshRenderers) {
271
+ skinnedMeshRenderer.rootBone = rig.bodyMesh.rootBone;
272
+ skinnedMeshRenderer.bones = rig.bodyMesh.bones;
273
+ }
274
+ }
266
275
  }
267
276
  }
268
277
  }
@@ -366,30 +375,30 @@ namespace Editor.Accessories {
366
375
  }
367
376
 
368
377
  private void SaveCurrentAccessory() {
369
- if (!_referenceAccessoryComponent) {
378
+ if (!referenceAccessoryComponent) {
370
379
  Debug.LogError("Trying to save with an empty accessory component");
371
380
  return;
372
381
  }
373
382
 
374
- Log("Saving acc: " + _referenceAccessoryComponent.gameObject.name);
375
- Undo.RecordObject(_referenceAccessoryComponent, "Save Accessory");
376
- _referenceAccessoryComponent.Copy(_editingAccessoryComponent);
377
- PrefabUtility.RecordPrefabInstancePropertyModifications(_referenceAccessoryComponent);
378
- EditorUtility.SetDirty(_referenceAccessoryComponent);
379
- PrefabUtility.ApplyPrefabInstance(_editingAccessoryComponent.gameObject, InteractionMode.UserAction);
383
+ Log("Saving acc: " + referenceAccessoryComponent.gameObject.name);
384
+ Undo.RecordObject(referenceAccessoryComponent, "Save Accessory");
385
+ referenceAccessoryComponent.Copy(editingAccessoryComponent);
386
+ PrefabUtility.RecordPrefabInstancePropertyModifications(referenceAccessoryComponent);
387
+ EditorUtility.SetDirty(referenceAccessoryComponent);
388
+ PrefabUtility.ApplyPrefabInstance(editingAccessoryComponent.gameObject, InteractionMode.UserAction);
380
389
  AssetDatabase.SaveAssets();
381
390
  }
382
391
 
383
392
  private void ResetCurrentAccessory() {
384
- if(!_referenceAccessoryComponent){
393
+ if(!referenceAccessoryComponent){
385
394
  Debug.LogError("Trying to reset an empty accessory component");
386
395
  return;
387
396
  }
388
- Log("Resetting acc: " + _referenceAccessoryComponent.gameObject.name);
389
- Undo.RecordObject(_editingAccessoryComponent.transform, "ResetTransform");
390
- _editingAccessoryComponent.transform.SetLocalPositionAndRotation(_referenceAccessoryComponent.localPosition, _referenceAccessoryComponent.localRotation);
391
- _editingAccessoryComponent.localScale = _referenceAccessoryComponent.localScale;
392
- PrefabUtility.RevertPrefabInstance(_editingAccessoryComponent.gameObject, InteractionMode.UserAction);
397
+ Log("Resetting acc: " + referenceAccessoryComponent.gameObject.name);
398
+ Undo.RecordObject(editingAccessoryComponent.transform, "ResetTransform");
399
+ editingAccessoryComponent.transform.SetLocalPositionAndRotation(referenceAccessoryComponent.localPosition, referenceAccessoryComponent.localRotation);
400
+ editingAccessoryComponent.localScale = referenceAccessoryComponent.localScale;
401
+ PrefabUtility.RevertPrefabInstance(editingAccessoryComponent.gameObject, InteractionMode.UserAction);
393
402
  }
394
403
 
395
404
  private void SetPose(PoseType poseType){
@@ -123,7 +123,15 @@ namespace Editor.Accessories.Clothing {
123
123
  req.SetRequestHeader("Authorization", "Bearer " + InternalHttpManager.editorAuthToken);
124
124
  req.SetRequestHeader("x-airship-ignore-rate-limit", "true");
125
125
  await req.SendWebRequest();
126
+ if (req.result != UnityWebRequest.Result.Success) {
127
+ Debug.LogError("Failed to update air asset: " + req.downloadHandler.text);
128
+ return;
129
+ }
126
130
  Debug.Log("Create classId response: " + req.downloadHandler.text);
131
+ var createResponse = JsonUtility.FromJson<GearCreateResponse>(req.downloadHandler.text);
132
+ gear.classId = createResponse.classId;
133
+ EditorUtility.SetDirty(gear);
134
+ AssetDatabase.SaveAssets();
127
135
  }
128
136
 
129
137
  string airId = manifest.airId;
@@ -224,7 +232,8 @@ namespace Editor.Accessories.Clothing {
224
232
  category = category,
225
233
  subcategory = subcategory,
226
234
  };
227
- var req = UnityWebRequest.Put($"{AirshipPlatformUrl.contentService}/gear/class-id/{gear.classId}",
235
+ var url = $"{AirshipPlatformUrl.contentService}/gear/class-id/{gear.classId}";
236
+ var req = UnityWebRequest.Put(url,
228
237
  JsonUtility.ToJson(data));
229
238
  req.method = "PATCH";
230
239
  req.SetRequestHeader("Content-Type","application/json");
@@ -232,7 +241,7 @@ namespace Editor.Accessories.Clothing {
232
241
  req.SetRequestHeader("x-airship-ignore-rate-limit", "true");
233
242
  await req.SendWebRequest();
234
243
  if (req.result != UnityWebRequest.Result.Success) {
235
- Debug.LogError("patch classId response: " + req.downloadHandler.text);
244
+ Debug.LogError($"patch classId. url: {url}, response: {req.downloadHandler.text}, authToken: {InternalHttpManager.editorAuthToken}");
236
245
  return;
237
246
  }
238
247
  }
@@ -4,7 +4,7 @@ using System.IO;
4
4
  using System.Linq;
5
5
  using System.Threading.Tasks;
6
6
  using Code.Accessories.Clothing;
7
- using Code.AirAsset;
7
+ using Code.AirAssetBundle;
8
8
  using Code.Bootstrap;
9
9
  using Code.Http.Internal;
10
10
  using Code.Platform.Shared;
@@ -174,7 +174,7 @@ namespace Editor.AirAsset {
174
174
  var addressableNames = assetPaths
175
175
  .Select((p) => p.ToLower())
176
176
  .Select((p) => {
177
- if (p.Contains(target.name + ".asset")) {
177
+ if (p.Contains(target.name.ToLower() + ".asset")) {
178
178
  // custom name so it's easier to find when loading
179
179
  return "_AirAssetBundle";
180
180
  }
@@ -31,7 +31,7 @@ public class ScriptBindingEditor : UnityEditor.Editor {
31
31
 
32
32
  public void OnEnable() {
33
33
  var comp = (Component)serializedObject.targetObject;
34
- var metadata = serializedObject.FindProperty("m_metadata");
34
+ var metadata = serializedObject.FindProperty("metadata");
35
35
  var metadataProperties = metadata.FindPropertyRelative("properties");
36
36
  for (var i = 0; i < metadataProperties.arraySize; i++) {
37
37
  var serializedProperty = metadataProperties.GetArrayElementAtIndex(i);
@@ -49,18 +49,18 @@ public class ScriptBindingEditor : UnityEditor.Editor {
49
49
 
50
50
  AirshipComponent binding = (AirshipComponent)target;
51
51
 
52
- if (binding.scriptFile == null && !string.IsNullOrEmpty(binding.m_fileFullPath)) {
53
- // Debug.Log("Setting Script File from Path: " + binding.m_fileFullPath);
54
- // binding.SetScriptFromPath(binding.m_fileFullPath, LuauContext.Game);
55
- if (binding.scriptFile == null) {
56
- Debug.LogWarning($"Failed to load script asset: {binding.m_fileFullPath}");
57
- EditorGUILayout.HelpBox("Missing reference. This is likely from renaming a script.\n\nOld path: " + binding.m_fileFullPath.Replace("Assets/Bundles/", ""), MessageType.Warning);
52
+ if (binding.script == null && !string.IsNullOrEmpty(binding.scriptPath)) {
53
+ // Debug.Log("Setting Script File from Path: " + binding.scriptPath);
54
+ // binding.SetScriptFromPath(binding.scriptPath, LuauContext.Game);
55
+ if (binding.script == null) {
56
+ Debug.LogWarning($"Failed to load script asset: {binding.scriptPath}");
57
+ EditorGUILayout.HelpBox("Missing reference. This is likely from renaming a script.\n\nOld path: " + binding.scriptPath.Replace("Assets/Bundles/", ""), MessageType.Warning);
58
58
  }
59
59
  }
60
60
 
61
61
  DrawScriptBindingProperties(binding);
62
62
 
63
- if (binding.scriptFile != null && binding.scriptFile.m_metadata != null) {
63
+ if (binding.script != null && binding.script.m_metadata != null) {
64
64
  if (ShouldReconcile(binding)) {
65
65
  binding.ReconcileMetadata();
66
66
  serializedObject.ApplyModifiedProperties();
@@ -70,8 +70,8 @@ public class ScriptBindingEditor : UnityEditor.Editor {
70
70
  CheckDefaults(binding);
71
71
  }
72
72
 
73
- if (binding.scriptFile != null) {
74
- var metadata = serializedObject.FindProperty("m_metadata");
73
+ if (binding.script != null) {
74
+ var metadata = serializedObject.FindProperty("metadata");
75
75
  var metadataName = metadata.FindPropertyRelative("name");
76
76
  if (!string.IsNullOrEmpty(metadataName.stringValue)) {
77
77
  DrawBinaryFileMetadata(binding, metadata);
@@ -87,6 +87,10 @@ public class ScriptBindingEditor : UnityEditor.Editor {
87
87
  EditorGUILayout.LabelField("Component Id", binding.GetAirshipComponentId().ToString());
88
88
  }
89
89
  EditorGUILayout.EndHorizontal();
90
+
91
+ EditorGUILayout.BeginHorizontal();
92
+ EditorGUILayout.LabelField("Context", binding.context.ToString());
93
+ EditorGUILayout.EndHorizontal();
90
94
  }
91
95
  #endif
92
96
 
@@ -155,10 +159,10 @@ public class ScriptBindingEditor : UnityEditor.Editor {
155
159
  }
156
160
 
157
161
  private void CheckDefaults(AirshipComponent binding) {
158
- var metadata = serializedObject.FindProperty("m_metadata");
162
+ var metadata = serializedObject.FindProperty("metadata");
159
163
 
160
164
  var metadataProperties = metadata.FindPropertyRelative("properties");
161
- var originalMetadataProperties = binding.scriptFile.m_metadata.properties;
165
+ var originalMetadataProperties = binding.script.m_metadata.properties;
162
166
 
163
167
  var setDefault = false;
164
168
 
@@ -201,12 +205,12 @@ public class ScriptBindingEditor : UnityEditor.Editor {
201
205
  }
202
206
 
203
207
  private bool ShouldReconcile(AirshipComponent binding) {
204
- if (binding.m_metadata == null || binding.scriptFile.m_metadata == null) return false;
208
+ if (binding.metadata == null || binding.script.m_metadata == null) return false;
205
209
 
206
- var metadata = serializedObject.FindProperty("m_metadata");
210
+ var metadata = serializedObject.FindProperty("metadata");
207
211
 
208
212
  var metadataProperties = metadata.FindPropertyRelative("properties");
209
- var originalMetadataProperties = binding.scriptFile.m_metadata?.properties;
213
+ var originalMetadataProperties = binding.script.m_metadata?.properties;
210
214
 
211
215
  if (metadataProperties.arraySize != originalMetadataProperties.Count) {
212
216
  return true;
@@ -282,27 +286,27 @@ public class ScriptBindingEditor : UnityEditor.Editor {
282
286
  private void DrawScriptBindingProperties(AirshipComponent binding) {
283
287
  EditorGUILayout.Space(5);
284
288
 
285
- var script = binding.scriptFile;
286
- var scriptPath = serializedObject.FindProperty("m_fileFullPath");
289
+ var script = binding.script;
290
+ var scriptPath = serializedObject.FindProperty("scriptPath");
287
291
  var content = new GUIContent {
288
292
  text = "Script",
289
293
  tooltip = scriptPath.stringValue,
290
294
  };
291
295
 
292
- if (binding.scriptFile != null && (binding.m_metadata != null || Application.isPlaying)) {
296
+ if (script != null && (binding.metadata != null || Application.isPlaying)) {
293
297
  GUI.enabled = false;
294
298
  }
295
299
 
296
300
  var newScript = EditorGUILayout.ObjectField(content, script, typeof(AirshipScript), true);
297
301
  if (newScript != script) {
298
- binding.scriptFile = (AirshipScript)newScript;
299
- scriptPath.stringValue = newScript == null ? "" : ((AirshipScript)newScript).assetPath;
302
+ binding.script = (AirshipScript)newScript;
303
+ scriptPath.stringValue = newScript == null ? "" : binding.script.m_path;
300
304
  serializedObject.ApplyModifiedProperties();
301
305
  }
302
306
 
303
307
  GUI.enabled = true;
304
308
 
305
- if (newScript == null) {
309
+ if (newScript == null && !Application.isPlaying) {
306
310
  EditorGUILayout.Space(5);
307
311
 
308
312
  var rect = GUILayoutUtility.GetLastRect();
@@ -312,8 +316,9 @@ public class ScriptBindingEditor : UnityEditor.Editor {
312
316
 
313
317
  EditorGUILayout.BeginHorizontal();
314
318
  if (GUILayout.Button("Select Airship Component", style)) {
315
- AirshipComponentDropdown dd = new AirshipComponentDropdown(new AdvancedDropdownState(), (binaryFile) => {
316
- binding.SetScript(binaryFile, Application.isPlaying);
319
+ AirshipComponentDropdown dd = new AirshipComponentDropdown(new AdvancedDropdownState(), (airshipScript) => {
320
+ binding.script = airshipScript;
321
+ binding.scriptPath = airshipScript.m_path;
317
322
  serializedObject.ApplyModifiedProperties();
318
323
  EditorUtility.SetDirty(serializedObject.targetObject);
319
324
  });
@@ -333,11 +338,11 @@ public class ScriptBindingEditor : UnityEditor.Editor {
333
338
  var propertyList = new List<SerializedProperty>();
334
339
  var indexDictionary = new Dictionary<string, int>();
335
340
 
336
- if (binding.scriptFile.m_metadata != null) {
341
+ if (binding.script.m_metadata != null) {
337
342
  for (var i = 0; i < metadataProperties.arraySize; i++) {
338
343
  var property = metadataProperties.GetArrayElementAtIndex(i);
339
344
  propertyList.Add(property);
340
- indexDictionary.Add(binding.scriptFile.m_metadata.properties[i].name, i);
345
+ indexDictionary.Add(binding.script.m_metadata.properties[i].name, i);
341
346
  }
342
347
  }
343
348
 
@@ -348,7 +353,7 @@ public class ScriptBindingEditor : UnityEditor.Editor {
348
353
  );
349
354
 
350
355
  foreach (var prop in propertyList) {
351
- DrawCustomProperty(binding.GetInstanceID(), binding.scriptFile.m_metadata, prop);
356
+ DrawCustomProperty(binding.GetInstanceID(), binding.script.m_metadata, prop);
352
357
  }
353
358
  }
354
359
 
@@ -532,13 +537,13 @@ public class ScriptBindingEditor : UnityEditor.Editor {
532
537
  var scriptPath = buildInfo.GetScriptPathByTypeName(typeName);
533
538
 
534
539
  switch (draggedObject) {
535
- case AirshipComponent component when scriptPath != null && buildInfo.Inherits(component.scriptFile, scriptPath):
540
+ case AirshipComponent component when scriptPath != null && buildInfo.Inherits(component.script, scriptPath):
536
541
  objRef = component;
537
542
  break;
538
543
  case AirshipComponent:
539
544
  continue;
540
545
  case GameObject go: {
541
- var firstMatchingComponent = go.GetComponents<AirshipComponent>().FirstOrDefault(f => buildInfo.Inherits(f.scriptFile, scriptPath));
546
+ var firstMatchingComponent = go.GetComponents<AirshipComponent>().FirstOrDefault(f => buildInfo.Inherits(f.script, scriptPath));
542
547
  if (firstMatchingComponent != null) {
543
548
  objRef = firstMatchingComponent;
544
549
  }
@@ -21,8 +21,7 @@ public class AirshipComponentHeaderHandler {
21
21
  if (inspectorMode == InspectorMode.Debug) return;
22
22
 
23
23
  var component = editorAndHeader.editor.target as Component;
24
- if (component is not AirshipComponent binding || binding.scriptFile == null ||
25
- !binding.scriptFile.airshipBehaviour) continue;
24
+ if (component is not AirshipComponent binding || binding.script == null || !binding.script.airshipBehaviour) continue;
26
25
 
27
26
  if(onGUIHandler.Method is { Name: "DrawWrappedHeaderGUI" }) continue;
28
27
 
@@ -15,7 +15,7 @@ internal static class AirshipComponentHeader {
15
15
  private static readonly GUIContent label = new GUIContent("");
16
16
 
17
17
  internal static float AfterComponentHeader(AirshipComponent component, Rect headerRect, bool isHeaderSelected) {
18
- var scriptFile = component.scriptFile;
18
+ var scriptFile = component.script;
19
19
  var metadata = scriptFile.m_metadata;
20
20
 
21
21
  if (metadata == null) return 0f;
@@ -69,25 +69,23 @@ internal class AirshipComponentHeaderWrapper {
69
69
  }
70
70
 
71
71
  public void DrawWrappedHeaderGUI() {
72
- if (component == null || component.scriptFile == null || !component.scriptFile.airshipBehaviour) {
72
+ if (component == null || component.script == null || !component.script.airshipBehaviour) {
73
73
  RemoveOverrideHeader();
74
74
  return;
75
75
  }
76
76
 
77
77
  Rect headerRect = headerElement.contentRect;
78
- bool HeaderIsSelected = headerElement.focusController.focusedElement == headerElement;
78
+ bool headerIsSelected = headerElement.focusController.focusedElement == headerElement;
79
79
 
80
80
  unityOnGUIHandler.Invoke();
81
81
 
82
- if (component.m_metadata.name != "") {
83
- AirshipComponentHeader.AfterComponentHeader(component, headerRect, HeaderIsSelected);
82
+ if (component.metadata.name != "") {
83
+ AirshipComponentHeader.AfterComponentHeader(component, headerRect, headerIsSelected);
84
84
  }
85
85
  }
86
86
 
87
- private void RemoveOverrideHeader()
88
- {
89
- if(headerElement is null)
90
- {
87
+ private void RemoveOverrideHeader() {
88
+ if (headerElement is null) {
91
89
  return;
92
90
  }
93
91
 
@@ -10,6 +10,10 @@ using Object = UnityEngine.Object;
10
10
  namespace Code.Luau {
11
11
  public static class AirshipScriptGUI {
12
12
  internal delegate Object AirshipBehaviourValidator(Object[] references, SerializedProperty property);
13
+
14
+ private static bool IsBindableAsComponent(AirshipComponent component, AirshipScript file) {
15
+ return file.assetPath == component.script.assetPath;
16
+ }
13
17
 
14
18
  private static Object Validate(Object[] references, AirshipScript script, AirshipComponent binding) {
15
19
  if (references.Length <= 0) return null;
@@ -21,13 +25,13 @@ namespace Code.Luau {
21
25
  references = gameObject.GetComponents(typeof(AirshipComponent));
22
26
  foreach (var reference in references) {
23
27
  if (reference != null && reference is AirshipComponent bindingComponent &&
24
- (bindingComponent.IsBindableAsComponent(script) ||
28
+ (IsBindableAsComponent(bindingComponent, script) ||
25
29
  buildInfo.ComponentIsValidInheritance(bindingComponent, script))) {
26
30
  return reference;
27
31
  }
28
32
  }
29
33
  }
30
- else if (objectReference is AirshipComponent otherBinding && (otherBinding.IsBindableAsComponent(script) || buildInfo.ComponentIsValidInheritance(otherBinding, script))) {
34
+ else if (objectReference is AirshipComponent otherBinding && (IsBindableAsComponent(otherBinding, script) || buildInfo.ComponentIsValidInheritance(otherBinding, script))) {
31
35
  return otherBinding;
32
36
  }
33
37
 
@@ -130,8 +134,7 @@ namespace Code.Luau {
130
134
  },
131
135
  item => {
132
136
  var itemScriptBinding = item.ToObject<AirshipComponent>();
133
- return itemScriptBinding != null &&
134
- itemScriptBinding.IsBindableAsComponent(script);
137
+ return itemScriptBinding != null && IsBindableAsComponent(itemScriptBinding, script);
135
138
  }, null, script.m_metadata?.displayName ?? "AirshipBehaviour");
136
139
  view.SetSearchText($"h:t:ScriptBinding"); // #m_fileFullPath={script.m_path}
137
140
 
@@ -168,7 +171,7 @@ namespace Code.Luau {
168
171
  case EventType.Repaint: {
169
172
  var temp = EditorGUIUtility.ObjectContent(obj, typeof(AirshipComponent));
170
173
 
171
- var scriptInfo = airshipComponent && airshipComponent.scriptFile ? airshipComponent.scriptFile : script;
174
+ var scriptInfo = airshipComponent && airshipComponent.script ? airshipComponent.script : script;
172
175
 
173
176
  var displayName = scriptInfo.m_metadata != null && !string.IsNullOrEmpty(scriptInfo.m_metadata.displayName)
174
177
  ? scriptInfo.m_metadata.displayName