gg.easy.airship 0.1.2184 → 0.1.2186
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.
- package/Editor/AirshipComponentEditor.cs +79 -15
- package/Editor/AirshipScriptGUI.cs +6 -1
- package/Editor/Build/AirshipIOSBuildProcessor.cs +1 -0
- package/Editor/BuildMenu.cs +99 -17
- package/Editor/EditorInternal/AirshipEditorInternals.cs +61 -1
- package/Editor/EditorInternal/AirshipObjectGUIInternal.cs +205 -0
- package/Editor/EditorInternal/AirshipObjectGUIInternal.cs.meta +3 -0
- package/Editor/StreamingAssets.cs +82 -0
- package/Editor/StreamingAssets.cs.meta +3 -0
- package/Editor/Util/AirshipEditorGUI.cs +29 -2
- package/Generator/LuauDirectCallbackGenerator.dll +0 -0
- package/Runtime/Code/AirshipConst.cs +9 -2
- package/Runtime/Code/Auth/AuthManager.cs +30 -4
- package/Runtime/Code/Authentication/EasyAuthenticator.cs +5 -2
- package/Runtime/Code/Bootstrap/AirshipEntryPoint.cs +11 -1
- package/Runtime/Code/Bootstrap/BundleDownloader.cs +10 -12
- package/Runtime/Code/Bootstrap/ClientBundleLoader.cs +17 -2
- package/Runtime/Code/Bootstrap/LuauScriptsDtoSerializer.cs +3 -3
- package/Runtime/Code/Bootstrap/ServerBootstrap.cs +3 -6
- package/Runtime/Code/Bundles/AirshipVersion.cs +1 -0
- package/Runtime/Code/CoreUI/CoreLoadingScreen.prefab +289 -1
- package/Runtime/Code/CoreUI/Loading/CoreLoadingScreen.cs +23 -0
- package/Runtime/Code/CoreUI/Login/LoginApp.cs +6 -0
- package/Runtime/Code/CoreUI/Login/PickUsernamePage.cs +4 -1
- package/Runtime/Code/CoreUI/MainMenu/MainMenuLoadingScreen.prefab +8 -8
- package/Runtime/Code/Easy.Airship.asmdef +2 -1
- package/Runtime/Code/Luau/AirshipComponent.cs +1 -1
- package/Runtime/Code/Luau/AirshipEditorInfo.cs +56 -2
- package/Runtime/Code/Luau/LuauAssembly/BinaryBlob.cs +39 -7
- package/Runtime/Code/Luau/LuauCoreCallbacks.cs +2 -2
- package/Runtime/Code/Luau/LuauCoreReflection.cs +25 -10
- package/Runtime/Code/Luau/LuauMetadata.cs +8 -0
- package/Runtime/Code/Luau/LuauMetadataPropertySerializer.cs +6 -0
- package/Runtime/Code/Luau/LuauPlugin.cs +1 -1
- package/Runtime/Code/Luau/LuauPluginNative.cs +5 -3
- package/Runtime/Code/Luau/ReflectionList.cs +9 -0
- package/Runtime/Code/LuauAPI/JobHandleAPI.cs +9 -0
- package/Runtime/Code/LuauAPI/JobHandleAPI.cs.meta +3 -0
- package/Runtime/Code/MainMenu/MainMenuSceneManager.cs +23 -16
- package/Runtime/Code/NativePlugins/Airship.NativePlugins.asmdef +16 -0
- package/Runtime/Code/NativePlugins/NativeDelegateAttribute.cs +4 -3
- package/Runtime/Code/NativePlugins/NativeLibUtil.cs +4 -3
- package/Runtime/Code/NativePlugins/NativePluginAttribute.cs +4 -3
- package/Runtime/Code/NativePlugins/NativePluginHandles.cs +153 -8
- package/Runtime/Code/Network/Simulation/AirshipSimulationManager.cs +3 -1
- package/Runtime/Code/Network/StateSystem/AirshipNetworkedStateManager.cs +10 -11
- package/Runtime/Code/Network/UdpPingTool.cs +10 -1
- package/Runtime/Code/PSO/PSOTraceManager.cs +2 -1
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterMovement.cs +2 -4
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterMovementSettings.cs +0 -14
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterPhysics.cs +11 -11
- package/Runtime/Code/Player/PlayerInfo.cs +3 -1
- package/Runtime/Code/Player/PlayerManagerBridge.cs +9 -13
- package/Runtime/Code/Player/UserData.cs +1 -0
- package/Runtime/Code/Quality/QualityManager.cs +72 -28
- package/Runtime/Code/UI/Canvas/CanvasUIEvents.cs +1 -0
- package/Runtime/Code/UI/ManageFullscreenSwitch.cs +4 -6
- package/Runtime/Code/VoiceChat/AirshipUniVoiceNetwork.cs +7 -3
- package/Runtime/Code/Window/WindowManager.cs +3 -3
- package/Runtime/Code/Zstd/ZstdNative.cs +3 -1
- package/Runtime/Plugins/Android/libLuauPlugin.so +0 -0
- package/Runtime/Plugins/Linux/libLuauPlugin.so +0 -0
- package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/Info.plist +2 -2
- package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/MacOS/LuauPlugin +0 -0
- package/Runtime/Plugins/Mac/Titlebar.bundle/Contents/Info.plist +46 -0
- package/{ThirdParty/TitlebarLib/libTitlebarLib.dylib → Runtime/Plugins/Mac/Titlebar.bundle/Contents/MacOS/Titlebar} +0 -0
- package/Runtime/Plugins/Mac/Titlebar.bundle/Contents/_CodeSignature/CodeResources +115 -0
- package/Runtime/Plugins/Mac/Titlebar.bundle.meta +2 -0
- package/Runtime/Plugins/Windows/x64/LuauPlugin.dll +0 -0
- package/Runtime/Plugins/iOS/LuauPluginIos.a +0 -0
- package/Runtime/Scenes/MainMenu.unity +82 -171
- package/ThirdParty/Mirror/Core/NetworkClient_TimeInterpolation.cs +3 -6
- package/ThirdParty/Mirror/Core/NetworkConnectionToClient.cs +2 -1
- package/ThirdParty/Sentry/Sentry.Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/ThirdParty/Sentry/Sentry.Microsoft.Bcl.AsyncInterfaces.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.System.Buffers.dll +0 -0
- package/ThirdParty/Sentry/Sentry.System.Buffers.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.System.Collections.Immutable.dll +0 -0
- package/ThirdParty/Sentry/Sentry.System.Collections.Immutable.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.System.Memory.dll +0 -0
- package/ThirdParty/Sentry/Sentry.System.Memory.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.System.Numerics.Vectors.dll +0 -0
- package/ThirdParty/Sentry/Sentry.System.Numerics.Vectors.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.System.Reflection.Metadata.dll +0 -0
- package/ThirdParty/Sentry/Sentry.System.Reflection.Metadata.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/ThirdParty/Sentry/Sentry.System.Runtime.CompilerServices.Unsafe.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.System.Text.Encodings.Web.dll +0 -0
- package/ThirdParty/Sentry/Sentry.System.Text.Encodings.Web.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.System.Text.Json.dll +0 -0
- package/ThirdParty/Sentry/Sentry.System.Text.Json.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.System.Threading.Tasks.Extensions.dll +0 -0
- package/ThirdParty/Sentry/Sentry.System.Threading.Tasks.Extensions.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.Unity.Android.dll +0 -0
- package/ThirdParty/Sentry/Sentry.Unity.Android.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.Unity.Native.dll +0 -0
- package/ThirdParty/Sentry/Sentry.Unity.Native.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.Unity.dll +0 -0
- package/ThirdParty/Sentry/Sentry.Unity.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.Unity.iOS.dll +0 -0
- package/ThirdParty/Sentry/Sentry.Unity.iOS.dll.meta +2 -0
- package/ThirdParty/Sentry/Sentry.dll +0 -0
- package/ThirdParty/Sentry/Sentry.dll.meta +2 -0
- package/ThirdParty/Sentry/io.sentry.unity.airship.asmdef +13 -0
- package/ThirdParty/Sentry/io.sentry.unity.airship.asmdef.meta +7 -0
- package/ThirdParty/Sentry.meta +8 -0
- package/package.json +1 -1
- package/Runtime/Code/NativePlugins/NativePlugins.asmdef +0 -3
- package/ThirdParty/TitlebarLib/libTitlebarLib.dylib.meta +0 -2
- /package/Runtime/Code/NativePlugins/{NativePlugins.asmdef.meta → Airship.NativePlugins.asmdef.meta} +0 -0
|
@@ -598,6 +598,9 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
598
598
|
case "IntEnum":
|
|
599
599
|
DrawCustomIntEnumProperty(guiContent, bindingProp, value, modified);
|
|
600
600
|
break;
|
|
601
|
+
case "FlagEnum":
|
|
602
|
+
DrawCustomFlagEnumProperty(guiContent, bindingProp, value, modified);
|
|
603
|
+
break;
|
|
601
604
|
case "boolean" or "bool":
|
|
602
605
|
DrawCustomBoolProperty(guiContent, type, decorators, value, modified);
|
|
603
606
|
break;
|
|
@@ -642,6 +645,11 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
642
645
|
GUILayout.Label($"{propName.stringValue}: {type.stringValue} not yet supported");
|
|
643
646
|
break;
|
|
644
647
|
}
|
|
648
|
+
|
|
649
|
+
if (Application.isPlaying) {
|
|
650
|
+
var component = (AirshipComponent)target;
|
|
651
|
+
component.WriteChangedComponentProperties();
|
|
652
|
+
}
|
|
645
653
|
|
|
646
654
|
if (hasOverride && Event.current.type == EventType.Repaint) {
|
|
647
655
|
var lastRect = GUILayoutUtility.GetLastRect();
|
|
@@ -851,11 +859,22 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
851
859
|
}
|
|
852
860
|
case AirshipComponentPropertyType.AirshipObject: {
|
|
853
861
|
var objOld = objectRefs.arraySize > index ? objectRefs.GetArrayElementAtIndex(index).objectReferenceValue : null;
|
|
854
|
-
|
|
855
|
-
if (
|
|
856
|
-
|
|
857
|
-
|
|
862
|
+
|
|
863
|
+
if (objectType == typeof(Sprite) || objectType == typeof(Texture2D)) {
|
|
864
|
+
var objNew = AirshipEditorGUI.ObjectField(rect, new GUIContent(label), objOld, objectType, true);
|
|
865
|
+
if (objOld != objNew) {
|
|
866
|
+
objectRefs.GetArrayElementAtIndex(index).objectReferenceValue = objNew;
|
|
867
|
+
arrayModified.boolValue = true;
|
|
868
|
+
}
|
|
869
|
+
} else {
|
|
870
|
+
var objNew = EditorGUI.ObjectField(rect, label, objOld, objectType, true);
|
|
871
|
+
if (objOld != objNew) {
|
|
872
|
+
objectRefs.GetArrayElementAtIndex(index).objectReferenceValue = objNew;
|
|
873
|
+
arrayModified.boolValue = true;
|
|
874
|
+
}
|
|
858
875
|
}
|
|
876
|
+
|
|
877
|
+
|
|
859
878
|
break;
|
|
860
879
|
}
|
|
861
880
|
default:
|
|
@@ -882,11 +901,11 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
882
901
|
{
|
|
883
902
|
newValue = Math.Max(Convert.ToInt32(minParams[0].value), newValue);
|
|
884
903
|
}
|
|
885
|
-
|
|
886
|
-
{
|
|
904
|
+
|
|
905
|
+
if (modifiers.TryGetValue("Max", out var maxParams)) {
|
|
887
906
|
newValue = Math.Min(Convert.ToInt32(maxParams[0].value), newValue);
|
|
888
907
|
}
|
|
889
|
-
|
|
908
|
+
|
|
890
909
|
if (newValue != currentValue) {
|
|
891
910
|
value.stringValue = newValue.ToString(CultureInfo.InvariantCulture);
|
|
892
911
|
modified.boolValue = true;
|
|
@@ -981,7 +1000,7 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
981
1000
|
|
|
982
1001
|
List<GUIContent> items = new();
|
|
983
1002
|
foreach (var item in enumerableType.members) {
|
|
984
|
-
items.Add(new GUIContent(ObjectNames.NicifyVariableName(item.Name)
|
|
1003
|
+
items.Add(new GUIContent(ObjectNames.NicifyVariableName(item.Name)) );
|
|
985
1004
|
}
|
|
986
1005
|
|
|
987
1006
|
int idx = 0;
|
|
@@ -1004,6 +1023,28 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
1004
1023
|
private void DrawCustomIntEnumProperty(GUIContent guiContent, LuauMetadataProperty metadataProperty,
|
|
1005
1024
|
SerializedProperty value, SerializedProperty modified) {
|
|
1006
1025
|
//
|
|
1026
|
+
if (!AirshipEditorInfo.Instance) {
|
|
1027
|
+
EditorGUILayout.HelpBox("Cannot find editor info", MessageType.Error);
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
if (metadataProperty.refPath == null) {
|
|
1032
|
+
EditorGUILayout.HelpBox("Cannot find refPath", MessageType.Error);
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
var tsEnum = AirshipEditorInfo.Enums.GetEnum(metadataProperty.refPath);
|
|
1037
|
+
if (tsEnum == null) {
|
|
1038
|
+
EditorGUILayout.HelpBox("Cannot find enum from refPath", MessageType.Error);
|
|
1039
|
+
return;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
DrawCustomIntEnumDropdown(guiContent, tsEnum, value, modified, null);
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
private void DrawCustomFlagEnumProperty(GUIContent guiContent, LuauMetadataProperty metadataProperty,
|
|
1046
|
+
SerializedProperty value, SerializedProperty modified) {
|
|
1047
|
+
|
|
1007
1048
|
if (!AirshipEditorInfo.Instance) return;
|
|
1008
1049
|
|
|
1009
1050
|
if (metadataProperty.refPath == null) {
|
|
@@ -1012,8 +1053,25 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
1012
1053
|
|
|
1013
1054
|
var tsEnum = AirshipEditorInfo.Enums.GetEnum(metadataProperty.refPath);
|
|
1014
1055
|
if (tsEnum == null) return;
|
|
1056
|
+
|
|
1057
|
+
int.TryParse(value.stringValue, out int currentMask);
|
|
1015
1058
|
|
|
1016
|
-
|
|
1059
|
+
#if AIRSHIP_INTERNAL
|
|
1060
|
+
EditorGUILayout.BeginHorizontal();
|
|
1061
|
+
#endif
|
|
1062
|
+
var newMask = EditorGUILayout.MaskField(guiContent, currentMask, tsEnum.flagNames);
|
|
1063
|
+
if (newMask != currentMask) {
|
|
1064
|
+
value.stringValue = newMask.ToString(CultureInfo.InvariantCulture);
|
|
1065
|
+
modified.boolValue = true;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
#if AIRSHIP_INTERNAL
|
|
1069
|
+
GUI.enabled = false;
|
|
1070
|
+
EditorGUILayout.IntField(newMask, GUILayout.Width(100));
|
|
1071
|
+
EditorGUILayout.Toggle("", tsEnum.isFlagLike, GUILayout.Width(30));
|
|
1072
|
+
GUI.enabled = true;
|
|
1073
|
+
EditorGUILayout.EndHorizontal();
|
|
1074
|
+
#endif
|
|
1017
1075
|
}
|
|
1018
1076
|
|
|
1019
1077
|
private void DrawCustomStringEnumProperty(GUIContent guiContent, LuauMetadataProperty metadataProperty, SerializedProperty value,
|
|
@@ -1097,11 +1155,11 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
1097
1155
|
{
|
|
1098
1156
|
currentValue = 0;
|
|
1099
1157
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
{
|
|
1103
|
-
value.stringValue =
|
|
1104
|
-
modified.boolValue = true;
|
|
1158
|
+
|
|
1159
|
+
int maskValue = EditorGUILayout.MaskField(guiContent, currentValue, GameConfig.Load().gameLayers);
|
|
1160
|
+
if (maskValue != currentValue) {
|
|
1161
|
+
value.stringValue = maskValue.ToString(CultureInfo.InvariantCulture);
|
|
1162
|
+
modified.boolValue = true;
|
|
1105
1163
|
}
|
|
1106
1164
|
}
|
|
1107
1165
|
|
|
@@ -1225,7 +1283,13 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
1225
1283
|
private void DrawCustomObjectProperty(GUIContent guiContent, SerializedProperty type, SerializedProperty modifiers, SerializedProperty obj, SerializedProperty objType, SerializedProperty modified) {
|
|
1226
1284
|
var currentObject = obj.objectReferenceValue;
|
|
1227
1285
|
var t = objType.stringValue != "" ? TypeReflection.GetTypeFromString(objType.stringValue) : typeof(Object);
|
|
1228
|
-
|
|
1286
|
+
|
|
1287
|
+
UnityEngine.Object newObject;
|
|
1288
|
+
if (t == typeof(Sprite) || t == typeof(Texture2D)) {
|
|
1289
|
+
newObject = AirshipEditorGUI.ObjectFieldLayout(guiContent, currentObject, t, true);
|
|
1290
|
+
} else {
|
|
1291
|
+
newObject = EditorGUILayout.ObjectField(guiContent, currentObject, t, true);
|
|
1292
|
+
}
|
|
1229
1293
|
|
|
1230
1294
|
if (newObject != currentObject) {
|
|
1231
1295
|
obj.objectReferenceValue = newObject;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#if UNITY_EDITOR
|
|
2
2
|
using System;
|
|
3
|
+
using Editor.EditorInternal;
|
|
3
4
|
using JetBrains.Annotations;
|
|
4
5
|
using Luau;
|
|
5
6
|
using UnityEditor;
|
|
@@ -187,7 +188,7 @@ namespace Code.Luau {
|
|
|
187
188
|
temp.image = displayIcon;
|
|
188
189
|
}
|
|
189
190
|
|
|
190
|
-
|
|
191
|
+
AirshipEditorGUI.nonClippingObjectField.Draw(position, temp, id, DragAndDrop.activeControlID == id,
|
|
191
192
|
position.Contains(Event.current.mousePosition));
|
|
192
193
|
|
|
193
194
|
|
|
@@ -242,6 +243,10 @@ namespace Code.Luau {
|
|
|
242
243
|
var r = EditorGUILayout.GetControlRect(false, ObjectField.singleLineHeight);
|
|
243
244
|
return AirshipBehaviourField(r, content, script, airshipComponent, null);
|
|
244
245
|
}
|
|
246
|
+
|
|
247
|
+
internal static Sprite AirshipSpriteField(Rect position, GUIContent content, Sprite sprite) {
|
|
248
|
+
return (Sprite) AirshipEditorInternals.DoCustomObjectField(position, content, sprite, typeof(Sprite));
|
|
249
|
+
}
|
|
245
250
|
}
|
|
246
251
|
}
|
|
247
252
|
#endif
|
|
@@ -19,6 +19,7 @@ namespace Editor.Build {
|
|
|
19
19
|
var root = plist.root;
|
|
20
20
|
var buildKey = "NSCameraUsageDescription";
|
|
21
21
|
root.SetString(buildKey, "Use the camera to take profile pictures.");
|
|
22
|
+
root.SetBoolean("ITSAppUsesNonExemptEncryption", false);
|
|
22
23
|
root.SetBoolean("GCSupportsGameMode", true);
|
|
23
24
|
File.WriteAllText(plistPath, plist.WriteToString());
|
|
24
25
|
#endif
|
package/Editor/BuildMenu.cs
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
using System;
|
|
3
3
|
using System.Collections.Generic;
|
|
4
4
|
using System.Linq;
|
|
5
|
+
using Code.Bootstrap;
|
|
6
|
+
using NUnit;
|
|
5
7
|
using UnityEditor;
|
|
6
8
|
using UnityEditor.Build;
|
|
7
9
|
using UnityEditor.Build.Profile;
|
|
@@ -78,7 +80,7 @@ namespace Editor {
|
|
|
78
80
|
locationPathName = $"build/StandaloneLinux64/{ServerExecutableName}",
|
|
79
81
|
options = BuildOptions.Development,
|
|
80
82
|
};
|
|
81
|
-
|
|
83
|
+
|
|
82
84
|
var report = BuildPipeline.BuildPlayer(options);
|
|
83
85
|
var summary = report.summary;
|
|
84
86
|
switch (summary.result) {
|
|
@@ -87,12 +89,18 @@ namespace Editor {
|
|
|
87
89
|
break;
|
|
88
90
|
case BuildResult.Failed:
|
|
89
91
|
Debug.Log("Build Linux failed");
|
|
92
|
+
#if GAME_CI
|
|
93
|
+
EditorApplication.Exit(1);
|
|
94
|
+
#endif
|
|
90
95
|
break;
|
|
91
96
|
default:
|
|
92
97
|
Debug.Log("Build Linux unexpected result:" + summary.result);
|
|
98
|
+
#if GAME_CI
|
|
99
|
+
EditorApplication.Exit(2);
|
|
100
|
+
#endif
|
|
93
101
|
break;
|
|
94
102
|
}
|
|
95
|
-
|
|
103
|
+
|
|
96
104
|
CreateAssetBundles.AddAllGameBundleScenes();
|
|
97
105
|
}
|
|
98
106
|
|
|
@@ -142,9 +150,15 @@ namespace Editor {
|
|
|
142
150
|
break;
|
|
143
151
|
case BuildResult.Failed:
|
|
144
152
|
Debug.LogError("Build Mac failed");
|
|
153
|
+
#if GAME_CI
|
|
154
|
+
EditorApplication.Exit(1);
|
|
155
|
+
#endif
|
|
145
156
|
break;
|
|
146
157
|
default:
|
|
147
158
|
Debug.LogError("Build Mac unexpected result:" + summary.result);
|
|
159
|
+
#if GAME_CI
|
|
160
|
+
EditorApplication.Exit(2);
|
|
161
|
+
#endif
|
|
148
162
|
break;
|
|
149
163
|
}
|
|
150
164
|
|
|
@@ -181,9 +195,15 @@ namespace Editor {
|
|
|
181
195
|
break;
|
|
182
196
|
case BuildResult.Failed:
|
|
183
197
|
Debug.LogError("Build Mac failed");
|
|
198
|
+
#if GAME_CI
|
|
199
|
+
EditorApplication.Exit(1);
|
|
200
|
+
#endif
|
|
184
201
|
break;
|
|
185
202
|
default:
|
|
186
203
|
Debug.LogError("Build Mac unexpected result:" + summary.result);
|
|
204
|
+
#if GAME_CI
|
|
205
|
+
EditorApplication.Exit(2);
|
|
206
|
+
#endif
|
|
187
207
|
break;
|
|
188
208
|
}
|
|
189
209
|
|
|
@@ -227,9 +247,15 @@ namespace Editor {
|
|
|
227
247
|
break;
|
|
228
248
|
case BuildResult.Failed:
|
|
229
249
|
Debug.LogError("Build iOS failed");
|
|
250
|
+
#if GAME_CI
|
|
251
|
+
EditorApplication.Exit(1);
|
|
252
|
+
#endif
|
|
230
253
|
break;
|
|
231
254
|
default:
|
|
232
255
|
Debug.LogError("Build iOS unexpected result:" + summary.result);
|
|
256
|
+
#if GAME_CI
|
|
257
|
+
EditorApplication.Exit(2);
|
|
258
|
+
#endif
|
|
233
259
|
break;
|
|
234
260
|
}
|
|
235
261
|
|
|
@@ -242,8 +268,16 @@ namespace Editor {
|
|
|
242
268
|
ReleaseAPK,
|
|
243
269
|
ReleaseAAB,
|
|
244
270
|
}
|
|
271
|
+
|
|
272
|
+
public enum AndroidEnvironment {
|
|
273
|
+
Production,
|
|
274
|
+
Staging,
|
|
275
|
+
}
|
|
245
276
|
|
|
246
|
-
public static void BuildAndroidClient(AndroidBuildType buildType) {
|
|
277
|
+
public static void BuildAndroidClient(AndroidBuildType buildType, AndroidEnvironment environment) {
|
|
278
|
+
#if AIRSHIP_PLAYER
|
|
279
|
+
StreamingAssets.SetCoreMaterialPlatform(AirshipPlatform.Android);
|
|
280
|
+
|
|
247
281
|
var development = buildType == AndroidBuildType.DevelopmentAPK;
|
|
248
282
|
var buildApk = buildType != AndroidBuildType.ReleaseAAB;
|
|
249
283
|
|
|
@@ -255,18 +289,35 @@ namespace Editor {
|
|
|
255
289
|
PlayerSettings.SplashScreen.show = false;
|
|
256
290
|
PlayerSettings.SetScriptingBackend(NamedBuildTarget.Android, ScriptingImplementation.IL2CPP);
|
|
257
291
|
PlayerSettings.Android.splitApplicationBinary = !buildApk;
|
|
258
|
-
|
|
292
|
+
PlayerSettings.Android.applicationEntry = AndroidApplicationEntry.GameActivity;
|
|
293
|
+
|
|
294
|
+
PlayerSettings.Android.keyaliasName = environment switch {
|
|
295
|
+
AndroidEnvironment.Production => "airship",
|
|
296
|
+
AndroidEnvironment.Staging => "airship-staging",
|
|
297
|
+
_ => throw new ArgumentOutOfRangeException(nameof(environment), environment, null)
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
var editorBuildScenes = new List<EditorBuildSettingsScene>();
|
|
301
|
+
foreach (var sceneName in scenes) {
|
|
302
|
+
editorBuildScenes.Add(new EditorBuildSettingsScene(sceneName, true));
|
|
303
|
+
}
|
|
304
|
+
|
|
259
305
|
BuildProfile buildProfile;
|
|
260
306
|
if (development) {
|
|
261
307
|
buildProfile = AssetDatabase.LoadAssetAtPath<BuildProfile>("Assets/Settings/Build Profiles/Android Debug.asset");
|
|
262
308
|
} else {
|
|
263
309
|
buildProfile = AssetDatabase.LoadAssetAtPath<BuildProfile>("Assets/Settings/Build Profiles/Android Google Play.asset");
|
|
264
310
|
}
|
|
265
|
-
|
|
266
|
-
var
|
|
267
|
-
|
|
268
|
-
|
|
311
|
+
|
|
312
|
+
var defines = new List<string>();
|
|
313
|
+
defines.Add("AIRSHIP_PLAYER");
|
|
314
|
+
if (environment == AndroidEnvironment.Staging) {
|
|
315
|
+
defines.Add("AIRSHIP_STAGING");
|
|
316
|
+
defines.Add("AIRSHIP_INTERNAL");
|
|
269
317
|
}
|
|
318
|
+
buildProfile.scriptingDefines = defines.ToArray();
|
|
319
|
+
|
|
320
|
+
var options = new BuildPlayerWithProfileOptions();
|
|
270
321
|
buildProfile.overrideGlobalScenes = true;
|
|
271
322
|
buildProfile.scenes = editorBuildScenes.ToArray();
|
|
272
323
|
options.buildProfile = buildProfile;
|
|
@@ -274,8 +325,9 @@ namespace Editor {
|
|
|
274
325
|
if (development) {
|
|
275
326
|
options.options = BuildOptions.Development | BuildOptions.ConnectWithProfiler;
|
|
276
327
|
}
|
|
277
|
-
|
|
278
|
-
var
|
|
328
|
+
|
|
329
|
+
var report = BuildPipeline.BuildPlayer(options);
|
|
330
|
+
|
|
279
331
|
var summary = report.summary;
|
|
280
332
|
switch (summary.result) {
|
|
281
333
|
case BuildResult.Succeeded:
|
|
@@ -284,13 +336,21 @@ namespace Editor {
|
|
|
284
336
|
break;
|
|
285
337
|
case BuildResult.Failed:
|
|
286
338
|
Debug.LogError("Build Android failed");
|
|
339
|
+
#if GAME_CI
|
|
340
|
+
EditorApplication.Exit(1);
|
|
341
|
+
#endif
|
|
287
342
|
break;
|
|
288
343
|
default:
|
|
289
344
|
Debug.LogError("Build Android unexpected result:" + summary.result);
|
|
345
|
+
#if GAME_CI
|
|
346
|
+
EditorApplication.Exit(2);
|
|
347
|
+
#endif
|
|
290
348
|
break;
|
|
291
349
|
}
|
|
292
|
-
|
|
350
|
+
|
|
351
|
+
StreamingAssets.ResetCoreMaterials();
|
|
293
352
|
CreateAssetBundles.AddAllGameBundleScenes();
|
|
353
|
+
#endif
|
|
294
354
|
}
|
|
295
355
|
|
|
296
356
|
#if AIRSHIP_PLAYER
|
|
@@ -324,19 +384,29 @@ namespace Editor {
|
|
|
324
384
|
BuildIOSClient(true, true);
|
|
325
385
|
}
|
|
326
386
|
|
|
327
|
-
[MenuItem("Airship/Create Binary/Client/Android (Google Play)", priority =
|
|
387
|
+
[MenuItem("Airship/Create Binary/Client/Android/Android Release (Google Play)", priority = 10)]
|
|
328
388
|
public static void BuildAndroidClientMenuItem() {
|
|
329
|
-
BuildAndroidClient(AndroidBuildType.ReleaseAAB);
|
|
389
|
+
BuildAndroidClient(AndroidBuildType.ReleaseAAB, AndroidEnvironment.Production);
|
|
330
390
|
}
|
|
331
391
|
|
|
332
|
-
[MenuItem("Airship/Create Binary/Client/Android
|
|
392
|
+
[MenuItem("Airship/Create Binary/Client/Android/Android APK", priority = 80)]
|
|
333
393
|
public static void BuildAndroidProdAPK() {
|
|
334
|
-
BuildAndroidClient(AndroidBuildType.ReleaseAPK);
|
|
394
|
+
BuildAndroidClient(AndroidBuildType.ReleaseAPK, AndroidEnvironment.Production);
|
|
335
395
|
}
|
|
336
396
|
|
|
337
|
-
[MenuItem("Airship/Create Binary/Client/Android (Development
|
|
397
|
+
[MenuItem("Airship/Create Binary/Client/Android/Android APK (Development)", priority = 80)]
|
|
338
398
|
public static void BuildAndroidDevelopmentClientMenuItem() {
|
|
339
|
-
BuildAndroidClient(AndroidBuildType.DevelopmentAPK);
|
|
399
|
+
BuildAndroidClient(AndroidBuildType.DevelopmentAPK, AndroidEnvironment.Production);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
[MenuItem("Airship/Create Binary/Client/Android/Android Staging APK", priority = 150)]
|
|
403
|
+
public static void BuildAndroidProdStagingAPK() {
|
|
404
|
+
BuildAndroidClient(AndroidBuildType.ReleaseAPK, AndroidEnvironment.Staging);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
[MenuItem("Airship/Create Binary/Client/Android/Android Staging APK (Development)", priority = 150)]
|
|
408
|
+
public static void BuildAndroidDevelopmentStagingClientMenuItem() {
|
|
409
|
+
BuildAndroidClient(AndroidBuildType.DevelopmentAPK, AndroidEnvironment.Staging);
|
|
340
410
|
}
|
|
341
411
|
#endif
|
|
342
412
|
|
|
@@ -371,9 +441,15 @@ namespace Editor {
|
|
|
371
441
|
break;
|
|
372
442
|
case BuildResult.Failed:
|
|
373
443
|
Debug.Log("Build Windows failed");
|
|
444
|
+
#if GAME_CI
|
|
445
|
+
EditorApplication.Exit(1);
|
|
446
|
+
#endif
|
|
374
447
|
break;
|
|
375
448
|
default:
|
|
376
449
|
Debug.Log("Build Windows unexpected result:" + summary.result);
|
|
450
|
+
#if GAME_CI
|
|
451
|
+
EditorApplication.Exit(2);
|
|
452
|
+
#endif
|
|
377
453
|
break;
|
|
378
454
|
}
|
|
379
455
|
|
|
@@ -407,9 +483,15 @@ namespace Editor {
|
|
|
407
483
|
break;
|
|
408
484
|
case BuildResult.Failed:
|
|
409
485
|
Debug.Log("Build Windows failed");
|
|
486
|
+
#if GAME_CI
|
|
487
|
+
EditorApplication.Exit(1);
|
|
488
|
+
#endif
|
|
410
489
|
break;
|
|
411
490
|
default:
|
|
412
491
|
Debug.Log("Build Windows unexpected result:" + summary.result);
|
|
492
|
+
#if GAME_CI
|
|
493
|
+
EditorApplication.Exit(2);
|
|
494
|
+
#endif
|
|
413
495
|
break;
|
|
414
496
|
}
|
|
415
497
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
using
|
|
1
|
+
using System;
|
|
2
|
+
using UnityEditor;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
using UnityEngine.EventSystems;
|
|
2
5
|
|
|
3
6
|
namespace Editor.EditorInternal {
|
|
4
7
|
public class AirshipEditorInternals {
|
|
@@ -11,5 +14,62 @@ namespace Editor.EditorInternal {
|
|
|
11
14
|
internal static bool GetBoldDefaultFont() {
|
|
12
15
|
return EditorGUIUtility.GetBoldDefaultFont();
|
|
13
16
|
}
|
|
17
|
+
|
|
18
|
+
internal static void ShowObjectSelector(UnityEngine.Object obj, Type objectTypes, UnityEngine.Object objBeingEdited, bool allowSceneObjects) {
|
|
19
|
+
ObjectSelector.get.Show(obj, objectTypes,objBeingEdited, allowSceneObjects);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
internal static UnityEngine.Object DoCustomObjectField(Rect position, GUIContent label,
|
|
23
|
+
UnityEngine.Object value, System.Type type) {
|
|
24
|
+
int id = "s_ObjectField".GetHashCode();
|
|
25
|
+
var eventType = Event.current;
|
|
26
|
+
|
|
27
|
+
position = EditorGUI.PrefixLabel(position, label);
|
|
28
|
+
|
|
29
|
+
switch (eventType.type) {
|
|
30
|
+
case EventType.MouseDown: {
|
|
31
|
+
if (position.Contains(UnityEngine.Event.current.mousePosition) &&
|
|
32
|
+
UnityEngine.Event.current.button == 0) {
|
|
33
|
+
// Rect buttonRect = EditorGUI.GetButtonRect(visualType, position);
|
|
34
|
+
EditorGUIUtility.editingTextField = false;
|
|
35
|
+
if (GUI.enabled) {
|
|
36
|
+
ShowObjectSelector(value, type, null, true);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case EventType.Repaint: {
|
|
43
|
+
EditorGUI.BeginHandleMixedValueContentColor();
|
|
44
|
+
|
|
45
|
+
GUIContent content = EditorGUIUtility.ObjectContent(value, type, false);
|
|
46
|
+
Color contentColor = GUI.contentColor;
|
|
47
|
+
float a = contentColor.a;
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
if (value == null) {
|
|
51
|
+
contentColor.a = 0.7f;
|
|
52
|
+
GUI.contentColor = contentColor;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
var buttonRect = new Rect(position.xMax - 19f, position.y, 19f, position.height);
|
|
56
|
+
Rect position1 = EditorStyles.objectFieldButton.margin.Remove(buttonRect);
|
|
57
|
+
EditorStyles.objectField.Draw(position, content, id, DragAndDrop.activeControlID == id,
|
|
58
|
+
position.Contains(UnityEngine.Event.current.mousePosition));
|
|
59
|
+
EditorStyles.objectFieldButton.Draw(position1, GUIContent.none, id,
|
|
60
|
+
DragAndDrop.activeControlID == id,
|
|
61
|
+
position1.Contains(UnityEngine.Event.current.mousePosition));
|
|
62
|
+
|
|
63
|
+
EditorGUI.EndHandleMixedValueContentColor();
|
|
64
|
+
break;
|
|
65
|
+
} finally {
|
|
66
|
+
contentColor.a = a;
|
|
67
|
+
GUI.contentColor = contentColor;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
14
74
|
}
|
|
15
75
|
}
|