gg.easy.airship 0.1.2191 → 0.1.2192

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 (86) hide show
  1. package/Editor/AirshipComponentEditor.cs +2 -2
  2. package/Editor/AirshipEditors/AirshipCustomEditors.cs +1 -1
  3. package/Editor/AirshipEditors/AirshipSerializedObject.cs +24 -3
  4. package/Editor/AirshipEditors/Properties/{AirshipPropertyExtensions.cs → AirshipEditorExtensions.cs} +68 -4
  5. package/Editor/AirshipEditors/Properties/AirshipSerializedArrayValue.cs +4 -0
  6. package/Editor/AirshipEditors/Properties/AirshipSerializedProperty.cs +2 -1
  7. package/Editor/AirshipEditors/Properties/AirshipSerializedValue.cs +2 -1
  8. package/Editor/AirshipScriptGUI.cs +18 -32
  9. package/Editor/EditorInternal/AirshipEditorInternals.cs +20 -2
  10. package/Editor/Publish/Deploy.cs +96 -70
  11. package/Editor/StyleSheets/AirshipSelectorWindow.dark.uss +15 -0
  12. package/Editor/StyleSheets/AirshipSelectorWindow.dark.uss.meta +11 -0
  13. package/Editor/StyleSheets/AirshipSelectorWindow.uss +17 -0
  14. package/Editor/StyleSheets/AirshipSelectorWindow.uss.meta +11 -0
  15. package/Editor/StyleSheets.meta +8 -0
  16. package/Editor/TypescriptAst/TypescriptCodeGen.cs +5 -1
  17. package/Editor/TypescriptCompiler~/utsc.js +107 -107
  18. package/Editor/TypescriptServices/Compiler/TypescriptCompilationService.cs +6 -3
  19. package/Editor/TypescriptServices/Compiler/TypescriptCompilerBuildArguments.cs +4 -4
  20. package/Editor/Util/AirshipComponentSelectorWindow.cs +274 -0
  21. package/Editor/Util/AirshipComponentSelectorWindow.cs.meta +3 -0
  22. package/Editor/Util/AirshipEditorGUI.internal.cs +9 -7
  23. package/Editor/Util/AirshipEditorUtil.cs +21 -16
  24. package/Runtime/Code/Luau/AirshipEditorInfo.cs +2 -8
  25. package/Runtime/Code/Luau/LuauCoreReflection.cs +5 -3
  26. package/Runtime/Code/Luau/LuauMetadata.cs +11 -5
  27. package/Runtime/Code/LuauAPI/TransformAPI.cs +11 -8
  28. package/Runtime/Code/Misc/AirshipBuildInfo.cs +17 -5
  29. package/Runtime/Code/Misc/AirshipType.cs +80 -6
  30. package/Runtime/Code/VoxelWorld/VoxelWorld.cs +3 -1
  31. package/Runtime/Code/VoxelWorld/VoxelWorldChunk.cs +8 -2
  32. package/Runtime/Plugins/Android/libLuauPlugin.so +0 -0
  33. package/Runtime/Plugins/Linux/libLuauPlugin.so +0 -0
  34. package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/MacOS/LuauPlugin +0 -0
  35. package/Runtime/Plugins/Windows/x64/LuauPlugin.dll +0 -0
  36. package/Runtime/Plugins/iOS/LuauPluginIos.a +0 -0
  37. package/ThirdParty/Unified-Universal-Blur-0.7.3/Editor/ShowAsPassDrawer.cs +66 -0
  38. package/ThirdParty/Unified-Universal-Blur-0.7.3/Editor/ShowAsPassDrawer.cs.meta +3 -0
  39. package/ThirdParty/Unified-Universal-Blur-0.7.3/Editor/Unified.Universal.Blur.Editor.asmdef +20 -0
  40. package/ThirdParty/Unified-Universal-Blur-0.7.3/Editor/Unified.Universal.Blur.Editor.asmdef.meta +7 -0
  41. package/ThirdParty/Unified-Universal-Blur-0.7.3/Editor.meta +8 -0
  42. package/ThirdParty/Unified-Universal-Blur-0.7.3/LICENSE +21 -0
  43. package/ThirdParty/Unified-Universal-Blur-0.7.3/LICENSE.meta +7 -0
  44. package/ThirdParty/Unified-Universal-Blur-0.7.3/README.md +64 -0
  45. package/ThirdParty/Unified-Universal-Blur-0.7.3/README.md.meta +7 -0
  46. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/BlurConfig.cs +21 -0
  47. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/BlurConfig.cs.meta +3 -0
  48. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/BlurPasses.cs +65 -0
  49. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/BlurPasses.cs.meta +3 -0
  50. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/BlurType.cs +9 -0
  51. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/BlurType.cs.meta +3 -0
  52. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/CommandBuffer/IWrappedCommandBuffer.cs +12 -0
  53. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/CommandBuffer/IWrappedCommandBuffer.cs.meta +3 -0
  54. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/CommandBuffer/WrappedCommandBuffer.cs +26 -0
  55. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/CommandBuffer/WrappedCommandBuffer.cs.meta +3 -0
  56. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/CommandBuffer/WrappedUnsafeCommandBuffer.cs +28 -0
  57. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/CommandBuffer/WrappedUnsafeCommandBuffer.cs.meta +3 -0
  58. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/CommandBuffer.meta +3 -0
  59. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/Constants.cs +16 -0
  60. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/Constants.cs.meta +3 -0
  61. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/PassData/IPassData.cs +15 -0
  62. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/PassData/IPassData.cs.meta +3 -0
  63. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/PassData/LegacyPassData.cs +40 -0
  64. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/PassData/LegacyPassData.cs.meta +3 -0
  65. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/PassData/RenderGraphPassData.cs +44 -0
  66. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/PassData/RenderGraphPassData.cs.meta +3 -0
  67. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/PassData.meta +3 -0
  68. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/ScaleBlurWith.cs +9 -0
  69. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/ScaleBlurWith.cs.meta +3 -0
  70. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/ShowAsPass.cs +16 -0
  71. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/ShowAsPass.cs.meta +3 -0
  72. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/Unified.UniversalBlur.Runtime.asmdef +17 -0
  73. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/Unified.UniversalBlur.Runtime.asmdef.meta +7 -0
  74. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/UniversalBlurFeature.cs +151 -0
  75. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/UniversalBlurFeature.cs.meta +12 -0
  76. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/UniversalBlurPass.cs +138 -0
  77. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime/UniversalBlurPass.cs.meta +3 -0
  78. package/ThirdParty/Unified-Universal-Blur-0.7.3/Runtime.meta +8 -0
  79. package/ThirdParty/Unified-Universal-Blur-0.7.3/package.json +26 -0
  80. package/ThirdParty/Unified-Universal-Blur-0.7.3/package.json.meta +10 -0
  81. package/ThirdParty/Unified-Universal-Blur-0.7.3.meta +8 -0
  82. package/URP/AirshipLowestURPAsset_Renderer.asset +25 -1
  83. package/URP/AirshipMobileURPAsset_Renderer.asset +25 -1
  84. package/URP/AirshipURPAsset_Renderer.asset +25 -1
  85. package/package.json +1 -1
  86. /package/Editor/AirshipEditors/Properties/{AirshipPropertyExtensions.cs.meta → AirshipEditorExtensions.cs.meta} +0 -0
@@ -942,7 +942,7 @@ public class ScriptBindingEditor : UnityEditor.Editor {
942
942
  var value = objectRefs.GetArrayElementAtIndex(index);
943
943
 
944
944
  var objOld = objectRefs.arraySize > index ? value.objectReferenceValue as AirshipComponent : null;
945
- var objNew = AirshipScriptGUI.AirshipBehaviourField(rect, new GUIContent(label), script, objOld, value);
945
+ var objNew = AirshipScriptGUI.AirshipBehaviourField(rect, new GUIContent(label), arraySerializedProperty.serializedObject.targetObject, script, objOld, value);
946
946
  if (objOld != objNew) {
947
947
  value.objectReferenceValue = objNew;
948
948
  arrayModified.boolValue = true;
@@ -1357,7 +1357,7 @@ public class ScriptBindingEditor : UnityEditor.Editor {
1357
1357
  return;
1358
1358
  }
1359
1359
 
1360
- var binding = AirshipScriptGUI.AirshipBehaviourField(guiContent, script, obj);
1360
+ var binding = AirshipScriptGUI.AirshipBehaviourField(guiContent, obj.serializedObject.targetObject, script, obj);
1361
1361
 
1362
1362
 
1363
1363
  if (binding != null && target is AirshipComponent parentBinding && binding == parentBinding) {
@@ -235,7 +235,7 @@ public static class AirshipCustomEditors {
235
235
 
236
236
 
237
237
  internal static AirshipEditor GetComponentEditorForType(AirshipType airshipType, AirshipComponent component, AirshipSerializedObject serializedObject) {
238
- if (!airshipType.AirshipBehaviour) return null;
238
+ if (airshipType.DeclarationType != AirshipDeclarationType.AirshipBehaviour) return null;
239
239
  var editorType = AirshipCustomEditors.GetEditorTypeForTypeName(airshipType.Name);
240
240
  var editor = AirshipCustomEditors.GetEditorForComponent(component, editorType, serializedObject);
241
241
  return editor;
@@ -35,7 +35,28 @@ public class AirshipSerializedObject {
35
35
 
36
36
  public AirshipType airshipType => AirshipBuildInfo.Instance.GetTypeByName(serializedName.stringValue);
37
37
  public AirshipComponent airshipComponent => (AirshipComponent)serializedObject.targetObject;
38
-
38
+ public UnityEngine.Object targetObject => serializedObject.targetObject;
39
+
40
+ internal AirshipSerializedObject() {}
41
+ public AirshipSerializedObject(AirshipComponent component) => Update(null, new SerializedObject(component), component.metadata);
42
+
43
+ [CanBeNull]
44
+ internal AirshipSerializedObject prefabAsset {
45
+ get {
46
+ if (PrefabUtility.IsPartOfPrefabInstance(serializedObject.targetObject)) {
47
+ var obj = new AirshipSerializedObject();
48
+ var original = (AirshipComponent) PrefabUtility.GetCorrespondingObjectFromOriginalSource(serializedObject.targetObject);
49
+ var serObj =
50
+ new SerializedObject(original);
51
+
52
+ obj.Update(this.editor, serObj, original.metadata);
53
+ return obj;
54
+ } else {
55
+ return null;
56
+ }
57
+ }
58
+ }
59
+
39
60
  internal void Update(AirshipEditor currentEditor, SerializedObject currentSerializedObject, LuauMetadata currentMetadata) {
40
61
  _propertyCache.Clear();
41
62
  serializedObject = currentSerializedObject;
@@ -59,7 +80,7 @@ public class AirshipSerializedObject {
59
80
  if (propertyName == targetPropertyName) {
60
81
  var propertyMetadata = metadata.FindProperty(targetPropertyName);
61
82
 
62
- var airshipProperty = new AirshipSerializedProperty(property, propertyMetadata, this.editor);
83
+ var airshipProperty = new AirshipSerializedProperty(this, property, propertyMetadata, this.editor);
63
84
  // _propertyCache.Add(targetPropertyName, airshipProperty);
64
85
  return airshipProperty;
65
86
  }
@@ -80,7 +101,7 @@ public class AirshipSerializedObject {
80
101
  if (bindingPropertyIndex == -1) continue;
81
102
  var bindingProperty = metadata.properties[bindingPropertyIndex];
82
103
 
83
- propertyList.Add(new AirshipSerializedProperty(property, bindingProperty, editor));
104
+ propertyList.Add(new AirshipSerializedProperty(this, property, bindingProperty, editor));
84
105
  indexDictionary.Add(bindingProperty.name, bindingPropertyIndex);
85
106
  }
86
107
 
@@ -7,7 +7,7 @@ using Mono.WebBrowser;
7
7
  using UnityEditor;
8
8
  using UnityEngine;
9
9
 
10
- public static class AirshipPropertyExtensions {
10
+ public static class AirshipEditorExtensions {
11
11
  public static UnityEngine.Object GetObject(this AirshipSerializedValue value) {
12
12
  if (value.type is AirshipSerializedType.AirshipBehaviour or AirshipSerializedType.Object) return value.objectReferenceValue;
13
13
  return null;
@@ -27,6 +27,40 @@ public static class AirshipPropertyExtensions {
27
27
  if (component.script.m_metadata == null) return null;
28
28
  return AirshipBuildInfo.Instance.GetTypeByName(component.script.m_metadata.name);
29
29
  }
30
+
31
+ private static IEnumerable<string> GetPathParts(Transform transform) {
32
+ var parent = transform;
33
+ while (parent != null) {
34
+ yield return parent.name;
35
+ parent = parent.transform.parent;
36
+ }
37
+ }
38
+
39
+ internal static string GetFullName(this GameObject gameObject) {
40
+ var parts = new List<string>();
41
+ parts.AddRange(GetPathParts(gameObject.transform));
42
+ parts.Reverse();
43
+ return "/" + string.Join("/", parts);
44
+ }
45
+
46
+ public static string NicifyName(this AirshipType type) {
47
+ return ObjectNames.NicifyVariableName(type.Name);
48
+ }
49
+
50
+ /// <summary>
51
+ /// Grab the type of component of the given airship script, or null if no component attached to the script
52
+ /// </summary>
53
+ /// <param name="script"></param>
54
+ /// <returns></returns>
55
+ [CanBeNull]
56
+ public static AirshipType GetComponentType(this AirshipScript script) {
57
+ // TODO: Get types by path
58
+ if (script.m_metadata != null) {
59
+ return AirshipBuildInfo.Instance.GetTypeByPathAndName(script.assetPath, script.m_metadata.name);
60
+ }
61
+
62
+ return null;
63
+ }
30
64
 
31
65
  /// <summary>
32
66
  /// Add the given AirshipBehaviour to the GameObject
@@ -40,7 +74,7 @@ public static class AirshipPropertyExtensions {
40
74
  throw new InvalidCastException("Cannot add invalid type");
41
75
  }
42
76
 
43
- if (!type.AirshipBehaviour) return null;
77
+ if (type.DeclarationType != AirshipDeclarationType.AirshipBehaviour) return null;
44
78
 
45
79
  var airshipScript = type.Script;
46
80
  if (airshipScript == null) throw new InvalidCastException($"Found type without script - {type.UniqueId}");
@@ -60,7 +94,7 @@ public static class AirshipPropertyExtensions {
60
94
  [CanBeNull]
61
95
  public static AirshipComponent GetAirshipComponent(this GameObject gameObject, AirshipType type) {
62
96
  if (type == null) return null;
63
- if (!type.AirshipBehaviour) return null;
97
+ if (type.DeclarationType != AirshipDeclarationType.AirshipBehaviour) return null;
64
98
 
65
99
  foreach (var airshipComponent in gameObject.GetComponents<AirshipComponent>()) {
66
100
  var componentType = airshipComponent.GetAirshipType();
@@ -80,7 +114,7 @@ public static class AirshipPropertyExtensions {
80
114
  /// <param name="type">The component type</param>
81
115
  /// <returns></returns>
82
116
  public static AirshipComponent[] GetAirshipComponents(this GameObject gameObject, AirshipType type) {
83
- List<AirshipComponent> components = new List<AirshipComponent>();
117
+ var components = new List<AirshipComponent>();
84
118
 
85
119
  if (type == null) return null;
86
120
  foreach (var airshipComponent in gameObject.GetComponents<AirshipComponent>()) {
@@ -94,4 +128,34 @@ public static class AirshipPropertyExtensions {
94
128
 
95
129
  return components.ToArray();
96
130
  }
131
+
132
+ public static AirshipComponent GetAirshipComponentInChildren(this GameObject gameObject, AirshipType type) {
133
+ if (type == null) return null;
134
+ foreach (var airshipComponent in gameObject.GetComponentsInChildren<AirshipComponent>()) {
135
+ var componentType = airshipComponent.GetAirshipType();
136
+ if (componentType == null) continue;
137
+
138
+ if (airshipComponent.GetAirshipType() == type) {
139
+ return airshipComponent;
140
+ }
141
+ }
142
+
143
+ return null;
144
+ }
145
+
146
+ public static AirshipComponent[] GetAirshipComponentsInChildren(this GameObject gameObject, AirshipType type) {
147
+ var components = new List<AirshipComponent>();
148
+
149
+ if (type == null) return null;
150
+ foreach (var airshipComponent in gameObject.GetComponentsInChildren<AirshipComponent>()) {
151
+ var componentType = airshipComponent.GetAirshipType();
152
+ if (componentType == null) continue;
153
+
154
+ if (airshipComponent.GetAirshipType() == type) {
155
+ components.Add(airshipComponent);
156
+ }
157
+ }
158
+
159
+ return components.ToArray();
160
+ }
97
161
  }
@@ -1,6 +1,8 @@
1
1
  using UnityEditor;
2
2
 
3
3
  public class AirshipSerializedArrayValue : AirshipSerializedValue {
4
+
5
+
4
6
  public AirshipSerializedArrayValue(AirshipSerializedProperty parentSerializedProperty, int index, SerializedProperty valueProperty, SerializedProperty objectValueProperty) {
5
7
  serializedModified = parentSerializedProperty.serializedModified;
6
8
 
@@ -17,5 +19,7 @@ public class AirshipSerializedArrayValue : AirshipSerializedValue {
17
19
  decorators = parentSerializedProperty.propertyMetadata.GetDecorators();
18
20
 
19
21
  this.editor = parentSerializedProperty.editor;
22
+
23
+ serializedObject = parentSerializedProperty.serializedObject;
20
24
  }
21
25
  }
@@ -49,12 +49,13 @@ public class AirshipSerializedProperty : AirshipSerializedValue {
49
49
  }
50
50
  }
51
51
 
52
- public AirshipSerializedProperty(SerializedProperty property, LuauMetadataProperty metadata, AirshipEditor editor) {
52
+ public AirshipSerializedProperty(AirshipSerializedObject serializedObject, SerializedProperty property, LuauMetadataProperty metadata, AirshipEditor editor) {
53
53
  serializedProperty = property;
54
54
  UpdateProperty();
55
55
  propertyMetadata = metadata;
56
56
  decorators = metadata.GetDecorators();
57
57
  this.editor = editor;
58
+ this.serializedObject = serializedObject;
58
59
  }
59
60
 
60
61
  internal void UpdateProperty() {
@@ -71,7 +71,8 @@ public abstract class AirshipSerializedValue {
71
71
  internal SerializedProperty serializedObjectType { get; set; }
72
72
  internal SerializedProperty serializedObjectValue { get; set; }
73
73
  internal LuauMetadataProperty propertyMetadata { get; set; }
74
-
74
+ public AirshipSerializedObject serializedObject { get; protected set; }
75
+
75
76
  internal AirshipEditor editor { get; set; }
76
77
 
77
78
  public string name => serializedName.stringValue;
@@ -4,6 +4,7 @@ using Editor.EditorInternal;
4
4
  using JetBrains.Annotations;
5
5
  using Luau;
6
6
  using UnityEditor;
7
+ using UnityEditor.SceneManagement;
7
8
  using UnityEditor.Search;
8
9
  using UnityEngine;
9
10
  using Object = UnityEngine.Object;
@@ -44,6 +45,7 @@ namespace Code.Luau {
44
45
  Rect dropRect,
45
46
  int id,
46
47
  AirshipScript script,
48
+ UnityEngine.Object objectBeingEdited,
47
49
  [CanBeNull] AirshipComponent airshipComponent,
48
50
  SerializedProperty property,
49
51
  bool allowSceneObjects,
@@ -116,29 +118,11 @@ namespace Code.Luau {
116
118
  if (GUI.enabled) {
117
119
  GUIUtility.keyboardControl = id;
118
120
 
119
- var searchContext = SearchService.CreateContext(string.Empty);
120
- var view = SearchService.ShowPicker(
121
- searchContext,
122
- (item, b) => {
123
- var obj = item.ToObject<AirshipComponent>();
124
- if (obj != null) {
125
- onObjectSelected?.Invoke(obj);
126
- }
127
-
128
- GUI.changed = true;
129
- },
130
- item => {
131
- var obj = item.ToObject<AirshipComponent>();
132
- if (obj != null) {
133
- EditorGUIUtility.PingObject(obj);
134
- }
135
- },
136
- item => {
137
- var itemScriptBinding = item.ToObject<AirshipComponent>();
138
- return itemScriptBinding != null && IsBindableAsComponent(itemScriptBinding, script);
139
- }, null, script.m_metadata?.displayName ?? "AirshipBehaviour");
140
- view.SetSearchText($"h:t:AirshipComponent airshipcomponent.script=\"{script.assetPath}\""); // #m_fileFullPath={script.m_path}
141
-
121
+ var componentType = script.GetComponentType();
122
+ if (componentType != null) {
123
+ var context = new AirshipComponentSelectionContext(objectBeingEdited, componentType, obj as AirshipComponent);
124
+ AirshipComponentSelectorWindow.Show(context, null, onObjectSelected);
125
+ }
142
126
  evt.Use();
143
127
  GUIUtility.ExitGUI();
144
128
  }
@@ -215,37 +199,39 @@ namespace Code.Luau {
215
199
  return (AirshipComponent) obj;
216
200
  }
217
201
 
218
- internal static AirshipComponent AirshipBehaviourField(Rect rect, GUIContent content, AirshipScript script, AirshipComponent airshipComponent, SerializedProperty property) {
202
+ internal static AirshipComponent AirshipBehaviourField(
203
+ Rect rect, GUIContent content, UnityEngine.Object objectBeingEdited, AirshipScript script, AirshipComponent airshipComponent, SerializedProperty property) {
219
204
  int id = GUIUtility.GetControlID("_airshipBehaviourFieldHash".GetHashCode(), FocusType.Keyboard, rect);
220
205
 
221
206
  rect = EditorGUI.PrefixLabel(rect, id, content);
222
207
  var value = DoAirshipBehaviourField(
223
- rect, rect, id, script, airshipComponent, property, true,
208
+ rect, rect, id, script, objectBeingEdited, airshipComponent, property, true,
224
209
  binding => {
225
210
  if (property != null) {
226
211
  property.objectReferenceValue = binding;
212
+ property.serializedObject.ApplyModifiedProperties();
227
213
  }
228
214
  },
229
215
  () => {
230
- Debug.Log("Remove object " + property.objectReferenceValue);
231
216
  property.objectReferenceValue = null;
217
+ property.serializedObject.ApplyModifiedProperties();
232
218
  });
233
219
 
234
220
  return value;
235
221
  }
236
222
 
237
- public static AirshipComponent AirshipBehaviourField(Rect r, GUIContent content, AirshipScript script, AirshipComponent airshipComponent) {
238
- return AirshipBehaviourField(r, content, script, airshipComponent, null);
223
+ public static AirshipComponent AirshipBehaviourField(Rect r, GUIContent content, UnityEngine.Object objectBeingEdited, AirshipScript script, AirshipComponent airshipComponent) {
224
+ return AirshipBehaviourField(r, content,objectBeingEdited, script, airshipComponent, null);
239
225
  }
240
226
 
241
- internal static AirshipComponent AirshipBehaviourField(GUIContent content, AirshipScript script, SerializedProperty property) {
227
+ internal static AirshipComponent AirshipBehaviourField(GUIContent content, UnityEngine.Object objectBeingEdited, AirshipScript script, SerializedProperty property) {
242
228
  var r = EditorGUILayout.GetControlRect(false, ObjectField.singleLineHeight);
243
- return AirshipBehaviourField(r, content, script, (AirshipComponent) property.objectReferenceValue, property);
229
+ return AirshipBehaviourField(r, content,objectBeingEdited, script, (AirshipComponent) property.objectReferenceValue, property);
244
230
  }
245
231
 
246
- public static AirshipComponent AirshipBehaviourField(GUIContent content, AirshipScript script, AirshipComponent airshipComponent) {
232
+ public static AirshipComponent AirshipBehaviourField(GUIContent content, UnityEngine.Object objectBeingEdited, AirshipScript script, AirshipComponent airshipComponent) {
247
233
  var r = EditorGUILayout.GetControlRect(false, ObjectField.singleLineHeight);
248
- return AirshipBehaviourField(r, content, script, airshipComponent, null);
234
+ return AirshipBehaviourField(r, content,objectBeingEdited, script, airshipComponent, null);
249
235
  }
250
236
 
251
237
  internal static Sprite AirshipSpriteField(Rect position, GUIContent content, Sprite sprite) {
@@ -1,7 +1,10 @@
1
1
  using System;
2
+ using System.Collections.Generic;
2
3
  using UnityEditor;
4
+ using UnityEditor.SceneManagement;
3
5
  using UnityEngine;
4
6
  using UnityEngine.EventSystems;
7
+ using UnityEngine.SceneManagement;
5
8
 
6
9
  namespace Editor.EditorInternal {
7
10
  public class AirshipEditorInternals {
@@ -15,8 +18,23 @@ namespace Editor.EditorInternal {
15
18
  return EditorGUIUtility.GetBoldDefaultFont();
16
19
  }
17
20
 
18
- internal static void ShowObjectSelector(UnityEngine.Object obj, Type objectTypes, UnityEngine.Object objBeingEdited, bool allowSceneObjects) {
19
- ObjectSelector.get.Show(obj, objectTypes,objBeingEdited, allowSceneObjects);
21
+ // internal static void ShowObjectSelector(UnityEngine.Object obj, Type objectTypes, UnityEngine.Object objBeingEdited, bool allowSceneObjects) {
22
+ // ObjectSelector.get.Show(obj, objectTypes,objBeingEdited, allowSceneObjects);
23
+ // }
24
+
25
+ internal static void ShowObjectSelector(UnityEngine.Object obj,
26
+ System.Type requiredType,
27
+ UnityEngine.Object objectBeingEdited,
28
+ bool allowSceneObjects,
29
+ List<int> allowedInstanceIDs = null,
30
+ Action<UnityEngine.Object> onObjectSelectorClosed = null,
31
+ Action<UnityEngine.Object> onObjectSelectedUpdated = null,
32
+ bool showNoneItem = true) {
33
+ ObjectSelector.get.Show(obj, requiredType, objectBeingEdited, allowSceneObjects, allowedInstanceIDs, onObjectSelectorClosed, onObjectSelectedUpdated);
34
+ }
35
+
36
+ internal static Scene GetObjectScene() {
37
+ return default;
20
38
  }
21
39
 
22
40
  internal static UnityEngine.Object DoCustomObjectField(Rect position, GUIContent label,
@@ -33,6 +33,12 @@ public class UploadInfo {
33
33
  }
34
34
 
35
35
  public class Deploy {
36
+ enum DeployAuthType {
37
+ None,
38
+ DeployKey,
39
+ EditorAuthToken,
40
+ }
41
+
36
42
  private static Dictionary<string, UploadInfo> uploadProgress = new();
37
43
  private static GameDto activeDeployTarget;
38
44
  public const ulong MAX_UPLOAD_KB = 500_000;
@@ -88,8 +94,20 @@ public class Deploy {
88
94
  EditorCoroutines.Execute((BuildAndDeploy(AirshipPlatformUtil.livePlatforms, false, false)));
89
95
  }
90
96
 
97
+ private static string GetDeployKey(DeployAuthType authType) {
98
+ switch (authType) {
99
+ case DeployAuthType.DeployKey:
100
+ return AuthConfig.instance.deployKey;
101
+ case DeployAuthType.EditorAuthToken:
102
+ return InternalHttpManager.editorAuthToken;
103
+ case DeployAuthType.None:
104
+ return null;
105
+ }
106
+ throw new Exception($"[Airship] Unknown auth type: {authType}");
107
+ }
108
+
91
109
  private static IEnumerator BuildAndDeploy(AirshipPlatform[] platforms, bool skipBuild = false, bool useCache = true, bool dontUpload = false) {
92
- var possibleKeys = new List<string>() { AuthConfig.instance.deployKey, InternalHttpManager.editorAuthToken };
110
+ var possibleKeys = new List<string> { GetDeployKey(DeployAuthType.DeployKey), GetDeployKey(DeployAuthType.EditorAuthToken) };
93
111
  possibleKeys.RemoveAll(string.IsNullOrEmpty);
94
112
  if (possibleKeys.Count == 0) {
95
113
  Debug.LogError("[Airship]: You aren't signed in. You can sign in by going to Airship->Sign in");
@@ -171,7 +189,7 @@ public class Deploy {
171
189
  } else if (useSplitCodeBundle) {
172
190
  var compileFlags = TypeScriptCompileFlags.Publishing
173
191
  | TypeScriptCompileFlags.DisplayProgressBar
174
- | TypeScriptCompileFlags.SkipPackages
192
+ | TypeScriptCompileFlags.CodeOnlyPublish
175
193
  | TypeScriptCompileFlags.SkipReimportQueue; // skipping packages in the bg
176
194
 
177
195
  TypescriptCompilationService.BuildTypescript(compileFlags);
@@ -185,7 +203,7 @@ public class Deploy {
185
203
 
186
204
  // Create deployment
187
205
  DeploymentDto deploymentDto = null;
188
- string devKey = null;
206
+ var deployAuthType = DeployAuthType.None;
189
207
  {
190
208
  List<string> platformStrings = new();
191
209
  platformStrings.Add("Mac");
@@ -195,8 +213,12 @@ public class Deploy {
195
213
  platformStrings.Add("Android");
196
214
  }
197
215
  var packageSlugs = gameConfig.packages.Select((p) => p.id);
198
- for (int i = 0; i < possibleKeys.Count; i++) {
199
- devKey = possibleKeys[i];
216
+ var authTypes = Enum.GetValues(typeof(DeployAuthType)).Cast<DeployAuthType>().ToList();
217
+ for (var i = 0; i < authTypes.Count; i++) {
218
+ deployAuthType = authTypes[i];
219
+ var key = GetDeployKey(deployAuthType);
220
+ if (string.IsNullOrEmpty(key)) continue;
221
+
200
222
  using UnityWebRequest req = UnityWebRequest.Post(
201
223
  $"{AirshipPlatformUrl.deploymentService}/game-versions/create-deployment", JsonUtility.ToJson(
202
224
  new CreateGameDeploymentDto() {
@@ -208,7 +230,7 @@ public class Deploy {
208
230
  packageSlugs = packageSlugs.ToArray(),
209
231
  platforms = platformStrings.ToArray(),
210
232
  }), "application/json");
211
- req.SetRequestHeader("Authorization", "Bearer " + devKey);
233
+ req.SetRequestHeader("Authorization", "Bearer " + key);
212
234
  yield return req.SendWebRequest();
213
235
  while (!req.isDone) {
214
236
  yield return null;
@@ -230,7 +252,7 @@ public class Deploy {
230
252
  }
231
253
 
232
254
  // We shouldn't get here. It will fail above.
233
- if (deploymentDto == null || devKey == null) {
255
+ if (deploymentDto == null || deployAuthType == DeployAuthType.None) {
234
256
  Debug.LogError("No valid authorization.");
235
257
  yield break;
236
258
  }
@@ -250,21 +272,21 @@ public class Deploy {
250
272
  paths.Add(path);
251
273
  }
252
274
 
253
- var airshipBuildInfoGuids = AssetDatabase.FindAssets("t:" + nameof(AirshipBuildInfo));
254
- foreach (var guid in airshipBuildInfoGuids) {
255
- var path = AssetDatabase.GUIDToAssetPath(guid).ToLower();
256
- paths.Add(path);
257
- }
275
+ // var airshipBuildInfoGuids = AssetDatabase.FindAssets("t:" + nameof(AirshipBuildInfo));
276
+ // foreach (var guid in airshipBuildInfoGuids) {
277
+ // var path = AssetDatabase.GUIDToAssetPath(guid).ToLower();
278
+ // paths.Add(path);
279
+ // }
258
280
 
259
281
  if (File.Exists(codeZipPath)) {
260
282
  File.Delete(codeZipPath);
261
283
  }
262
284
  var codeZip = new ZipFile();
263
285
  foreach (var path in paths) {
264
- if (path.EndsWith(".asbuildinfo")) {
265
- codeZip.AddEntry(path, File.ReadAllBytes(path));
266
- continue;
267
- }
286
+ // if (path.EndsWith(".asbuildinfo")) {
287
+ // codeZip.AddEntry(path, File.ReadAllBytes(path));
288
+ // continue;
289
+ // }
268
290
 
269
291
  // GetOutputPath is case sensitive so hacky workaround is to make our path start with capital "A"
270
292
  var luaOutPath = TypescriptProjectsService.Project.GetOutputPath(path.Replace("assets/", "Assets/"));
@@ -455,60 +477,7 @@ public class Deploy {
455
477
  Debug.Log($"Completed upload{sizeSnippet}. Finalizing publish...");
456
478
 
457
479
  // Complete deployment
458
- {
459
- List<string> uploadedFileIds = new();
460
- uploadedFileIds.Add("Mac_shared_resources");
461
- uploadedFileIds.Add("Mac_shared_scenes");
462
- uploadedFileIds.Add("Windows_shared_resources");
463
- uploadedFileIds.Add("Windows_shared_scenes");
464
- if (gameConfig.supportsMobile) {
465
- uploadedFileIds.Add("iOS_shared_resources");
466
- uploadedFileIds.Add("iOS_shared_scenes");
467
- uploadedFileIds.Add("Android_shared_resources");
468
- uploadedFileIds.Add("Android_shared_scenes");
469
- }
470
-
471
- int attemptNum = 0;
472
- while (attemptNum < 5) {
473
- // Debug.Log("Complete. GameId: " + gameConfig.gameId + ", assetVersionId: " + deploymentDto.version.assetVersionNumber);
474
- UnityWebRequest req = UnityWebRequest.Post(
475
- $"{AirshipPlatformUrl.deploymentService}/game-versions/complete-deployment", JsonUtility.ToJson(
476
- new CompleteGameDeploymentDto() {
477
- gameId = gameConfig.gameId,
478
- gameVersionId = deploymentDto.version.gameVersionId,
479
- uploadedFileIds = uploadedFileIds.ToArray(),
480
- }), "application/json");
481
- req.SetRequestHeader("Authorization", "Bearer " + devKey);
482
- yield return req.SendWebRequest();
483
- while (!req.isDone) {
484
- yield return null;
485
- }
486
-
487
- if (req.result == UnityWebRequest.Result.Success) {
488
- break;
489
- } else {
490
- Debug.LogError("Failed to complete deployment: " + req.error + " " + req.downloadHandler.text);
491
- if (req.responseCode == 400) {
492
- // don't retry on 400
493
- yield break;
494
- }
495
-
496
- if (attemptNum == 4) {
497
- // Out of retry attempts so we end it here.
498
- yield break;
499
- }
500
-
501
- // Wait one second and try again.
502
- int waitTime = 1;
503
- if (attemptNum >= 3) {
504
- waitTime = 3;
505
- }
506
- Debug.Log($"Retrying in {waitTime}s...");
507
- attemptNum++;
508
- yield return new WaitForSeconds(waitTime);
509
- }
510
- }
511
- }
480
+ yield return CompleteDeployment(gameConfig, deploymentDto.version.gameVersionId, GetDeployKey(deployAuthType));
512
481
 
513
482
  // Switch back to starting build target
514
483
  EditorUserBuildSettings.SwitchActiveBuildTarget(startingBuildGroup, startingBuildTarget);
@@ -647,6 +616,63 @@ public class Deploy {
647
616
  }
648
617
  }
649
618
 
619
+ private static IEnumerator CompleteDeployment(GameConfig gameConfig, string gameVersionId, string devKey) {
620
+ {
621
+ List<string> uploadedFileIds = new();
622
+ uploadedFileIds.Add("Mac_shared_resources");
623
+ uploadedFileIds.Add("Mac_shared_scenes");
624
+ uploadedFileIds.Add("Windows_shared_resources");
625
+ uploadedFileIds.Add("Windows_shared_scenes");
626
+ if (gameConfig.supportsMobile) {
627
+ uploadedFileIds.Add("iOS_shared_resources");
628
+ uploadedFileIds.Add("iOS_shared_scenes");
629
+ uploadedFileIds.Add("Android_shared_resources");
630
+ uploadedFileIds.Add("Android_shared_scenes");
631
+ }
632
+
633
+ int attemptNum = 0;
634
+ while (attemptNum < 5) {
635
+ // Debug.Log("Complete. GameId: " + gameConfig.gameId + ", assetVersionId: " + deploymentDto.version.assetVersionNumber);
636
+ UnityWebRequest req = UnityWebRequest.Post(
637
+ $"{AirshipPlatformUrl.deploymentService}/game-versions/complete-deployment", JsonUtility.ToJson(
638
+ new CompleteGameDeploymentDto() {
639
+ gameId = gameConfig.gameId,
640
+ gameVersionId = gameVersionId,
641
+ uploadedFileIds = uploadedFileIds.ToArray(),
642
+ }), "application/json");
643
+ req.SetRequestHeader("Authorization", "Bearer " + devKey);
644
+ yield return req.SendWebRequest();
645
+ while (!req.isDone) {
646
+ yield return null;
647
+ }
648
+
649
+ if (req.result == UnityWebRequest.Result.Success) {
650
+ break;
651
+ } else {
652
+ Debug.LogError("Failed to complete deployment: " + req.error + " " + req.downloadHandler.text);
653
+ if (req.responseCode == 400) {
654
+ // don't retry on 400
655
+ yield break;
656
+ }
657
+
658
+ if (attemptNum == 4) {
659
+ // Out of retry attempts so we end it here.
660
+ yield break;
661
+ }
662
+
663
+ // Wait one second and try again.
664
+ int waitTime = 1;
665
+ if (attemptNum >= 3) {
666
+ waitTime = 3;
667
+ }
668
+ Debug.Log($"Retrying in {waitTime}s...");
669
+ attemptNum++;
670
+ yield return new WaitForSeconds(waitTime);
671
+ }
672
+ }
673
+ }
674
+ }
675
+
650
676
  private static bool IsDirectoryEmpty(string path)
651
677
  {
652
678
  IEnumerable<string> items = Directory.EnumerateFileSystemEntries(path);
@@ -0,0 +1,15 @@
1
+ .unity-collection-view__item--selected {
2
+ background-color: #2C5D87;
3
+ color: #fff;
4
+ }
5
+
6
+ .unity-tab-view {
7
+ background-color: #333333;
8
+ }
9
+
10
+ .details-pane {
11
+ background-color: #282828;
12
+ flex-direction: row;
13
+ align-items: center;
14
+ }
15
+
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 354ed37fb1debc54a83686ffc7c92020
3
+ ScriptedImporter:
4
+ internalIDToNameTable: []
5
+ externalObjects: {}
6
+ serializedVersion: 2
7
+ userData:
8
+ assetBundleName:
9
+ assetBundleVariant:
10
+ script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
11
+ disableValidation: 0
@@ -0,0 +1,17 @@
1
+ .asset-details-icon {
2
+ width: 64px;
3
+ height: 64px;
4
+ align-self: center;
5
+ }
6
+
7
+ .asset-details-inner {
8
+ margin-left: 10px;
9
+ }
10
+
11
+ .asset-details-path {
12
+ color: #aeaeae;
13
+ }
14
+
15
+ .component-search-field {
16
+ margin-right: 50px;
17
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: f6146659f21b72b4bb3c3d1ff43c1ae3
3
+ ScriptedImporter:
4
+ internalIDToNameTable: []
5
+ externalObjects: {}
6
+ serializedVersion: 2
7
+ userData:
8
+ assetBundleName:
9
+ assetBundleVariant:
10
+ script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
11
+ disableValidation: 0