gg.easy.airship 0.1.2171 → 0.1.2173
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/Accessories/AccessoryOutfitEditor.cs +23 -23
- package/Editor/AirshipComponentEditor.cs +107 -11
- package/Editor/Assets/AudioAssetPostProcessor.cs +36 -0
- package/Editor/Assets/AudioAssetPostProcessor.cs.meta +3 -0
- package/Editor/Assets.meta +3 -0
- package/Editor/BuildMenu.cs +39 -9
- package/Editor/CreateAssetBundles.cs +25 -1
- package/Editor/Packages/AirshipPackagesWindow.cs +8 -0
- package/Editor/Quality/QualityConfig.cs +209 -0
- package/Editor/Quality/QualityConfig.cs.meta +3 -0
- package/Editor/Quality.meta +3 -0
- package/Editor/TypescriptServices/Editor/TypescriptLogService.cs +41 -30
- package/Runtime/Code/Agones/AgonesProxy.cs +6 -9
- package/Runtime/Code/AirshipConst.cs +3 -3
- package/Runtime/Code/Android/AirshipAndroidAPI.cs +85 -0
- package/Runtime/Code/Android/AirshipAndroidAPI.cs.meta +3 -0
- package/Runtime/Code/Android/AndroidManager.cs +13 -0
- package/Runtime/Code/Android/AndroidManager.cs.meta +3 -0
- package/Runtime/Code/Android.meta +3 -0
- package/Runtime/Code/Authentication/EasyAuthenticator.cs +1 -1
- package/Runtime/Code/Bootstrap/AirshipEntryPoint.cs +1 -1
- package/Runtime/Code/Bundles/SystemRoot.cs +2 -1
- package/Runtime/Code/CoreUI/Login/ContinueWithApple.png.meta +12 -9
- package/Runtime/Code/CoreUI/Login/ContinueWithGoogle.png.meta +11 -8
- package/Runtime/Code/GameConfig/GameConfig.cs +3 -0
- package/Runtime/Code/Luau/LuauCompiler.cs +2 -1
- package/Runtime/Code/Luau/LuauCoreCallbacks.cs +17 -17
- package/Runtime/Code/Luau/LuauPlugin.cs +19 -5
- package/Runtime/Code/Player/PlayerManagerBridge.cs +289 -283
- package/Runtime/Code/ProjectSetup/Editor/SetupManager.cs +1 -1
- package/Runtime/Code/ProjectSetup/PhysicsSetup.cs +8 -12
- package/Runtime/Code/VoxelWorld/Resources/VoxelWorldMatURP.mat +3 -3
- package/Runtime/Code/VoxelWorld/TexturePacker.cs +12 -9
- package/Runtime/Code/VoxelWorld/VoxelBlocks.cs +26 -5
- package/Runtime/Code/VoxelWorld/VoxelWorldChunk.cs +10 -7
- package/Runtime/Plugins/Android/libLuauPlugin.so +0 -0
- package/Runtime/Plugins/Linux/libLuauPlugin.so +0 -0
- package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/MacOS/LuauPlugin +0 -0
- package/Runtime/Plugins/Windows/x64/LuauPlugin.dll +0 -0
- package/Runtime/Plugins/iOS/LuauPluginIos.a +0 -0
- package/Runtime/Scenes/CoreScene.unity +395 -349
- package/Runtime/Scenes/Login.unity +396 -351
- package/Runtime/Scenes/MainMenu.unity +48 -2
- package/ScriptableBuildPipeline/Editor/Tasks/ArchiveAndCompressBundles.cs +1 -1
- package/ThirdParty/Agones/AgonesSdk.cs +10 -7
- package/URP/AirshipAndroidURPAsset.asset +136 -0
- package/{Runtime/Plugins/Windows/x64/LuauPlugin.pdb.meta → URP/AirshipAndroidURPAsset.asset.meta} +3 -2
- package/URP/AirshipLowestURPAsset.asset +136 -0
- package/URP/AirshipLowestURPAsset.asset.meta +8 -0
- package/URP/AirshipLowestURPAsset_Renderer.asset +268 -0
- package/URP/AirshipLowestURPAsset_Renderer.asset.meta +8 -0
- package/URP/AirshipMobileURPAsset.asset +136 -0
- package/URP/AirshipMobileURPAsset.asset.meta +8 -0
- package/URP/AirshipMobileURPAsset_Renderer.asset +290 -0
- package/URP/AirshipMobileURPAsset_Renderer.asset.meta +8 -0
- package/URP/AirshipURPAsset.asset +1 -1
- package/package.json +1 -1
- package/Runtime/Plugins/Windows/x64/LuauPlugin.pdb +0 -0
|
@@ -16,27 +16,27 @@ public class AccessoryOutfitEditor : UnityEditor.Editor{
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
[MenuItem("Airship/Open Asset Bundle")]
|
|
20
|
-
public static void TestOpenAssetBundle() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
19
|
+
// [MenuItem("Airship/Open Asset Bundle")]
|
|
20
|
+
// public static void TestOpenAssetBundle() {
|
|
21
|
+
// string path = "Assets/TestBundles/CoreMaterials";
|
|
22
|
+
// AssetBundle bundle = AssetBundle.LoadFromFile(path);
|
|
23
|
+
// if (bundle == null) {
|
|
24
|
+
// Debug.LogError("Failed to load asset bundle.");
|
|
25
|
+
// }
|
|
26
|
+
//
|
|
27
|
+
// Debug.Log("<color=green>Success!</color>");
|
|
28
|
+
//
|
|
29
|
+
// foreach (var name in bundle.GetAllAssetNames()) {
|
|
30
|
+
// Debug.Log(" - " + name);
|
|
31
|
+
// }
|
|
32
|
+
//
|
|
33
|
+
// Debug.Log("------------");
|
|
34
|
+
// GameObject prefab = bundle.LoadAsset<GameObject>("assets/airshippackages/@easy/corematerials/materiallibrary/codestrip/__decal projector.prefab");
|
|
35
|
+
// GameObject go = Object.Instantiate(prefab);
|
|
36
|
+
// Debug.Log("Instantiated " + go.name);
|
|
37
|
+
//
|
|
38
|
+
// Debug.Log("Unloading bundle...");
|
|
39
|
+
// bundle.Unload(true);
|
|
40
|
+
// Debug.Log("Unloaded.");
|
|
41
|
+
// }
|
|
42
42
|
}
|
|
@@ -21,6 +21,14 @@ public struct ArrayDisplayInfo {
|
|
|
21
21
|
public AirshipComponentPropertyType listType;
|
|
22
22
|
public Type objType;
|
|
23
23
|
public string errorReason;
|
|
24
|
+
|
|
25
|
+
internal bool IsArrayDataMismatched(SerializedObject serializedObject, SerializedProperty serializedArray) {
|
|
26
|
+
try {
|
|
27
|
+
return serializedArray.propertyPath != reorderableList.serializedProperty.propertyPath;
|
|
28
|
+
} catch (ObjectDisposedException exception) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
[CustomEditor(typeof(AirshipComponent))]
|
|
@@ -29,7 +37,7 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
29
37
|
private static Dictionary<(string, string), bool> _openPropertyFoldouts = new();
|
|
30
38
|
|
|
31
39
|
/** Maps (game object id, prop name) to ArrayDisplayInfo object (for Array properties) */
|
|
32
|
-
private Dictionary<(int, string), ArrayDisplayInfo> _reorderableLists = new();
|
|
40
|
+
private Dictionary<(int componentInstanceId, string propertyName), ArrayDisplayInfo> _reorderableLists = new();
|
|
33
41
|
|
|
34
42
|
public void OnEnable() {
|
|
35
43
|
var comp = (Component)serializedObject.targetObject;
|
|
@@ -44,6 +52,14 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
54
|
|
|
55
|
+
private void OnDisable() {
|
|
56
|
+
var comp = (AirshipComponent)serializedObject.targetObject;
|
|
57
|
+
if (comp == null) return;
|
|
58
|
+
|
|
59
|
+
var componentInstanceId = comp.GetInstanceID();
|
|
60
|
+
_componentSeenArrayProps.Remove(componentInstanceId);
|
|
61
|
+
}
|
|
62
|
+
|
|
47
63
|
private bool debugging = false;
|
|
48
64
|
|
|
49
65
|
public override void OnInspectorGUI() {
|
|
@@ -99,21 +115,53 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
99
115
|
serializedObject.ApplyModifiedProperties();
|
|
100
116
|
}
|
|
101
117
|
|
|
118
|
+
|
|
119
|
+
private Dictionary<int, HashSet<string>> _componentSeenArrayProps = new();
|
|
120
|
+
private void CleanupOrphanedArrayDisplayInfos(int componentInstanceId) {
|
|
121
|
+
// We need to make sure we clean out dead array references
|
|
122
|
+
if (!_componentSeenArrayProps.TryGetValue(componentInstanceId, out var seenArrayProps)) return;
|
|
123
|
+
var removeSet = new HashSet<(int, string)>();
|
|
124
|
+
|
|
125
|
+
foreach (var (key, value) in _reorderableLists) {
|
|
126
|
+
if (key.componentInstanceId != componentInstanceId) continue;
|
|
127
|
+
if (seenArrayProps.Contains(key.propertyName)) continue;
|
|
128
|
+
|
|
129
|
+
// We cannot remove from a collection while iterating it, so we'll add it to a remove set
|
|
130
|
+
removeSet.Add(key);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// array list removal pass
|
|
134
|
+
foreach (var item in removeSet) {
|
|
135
|
+
_reorderableLists.Remove(item);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
private HashSet<string> GetOrCreateSeenArraysSet(int componentInstanceId) {
|
|
140
|
+
if (_componentSeenArrayProps.TryGetValue(componentInstanceId, out var seenArrays)) return seenArrays;
|
|
141
|
+
|
|
142
|
+
seenArrays = new HashSet<string>();
|
|
143
|
+
_componentSeenArrayProps.Add(componentInstanceId, seenArrays);
|
|
144
|
+
return seenArrays;
|
|
145
|
+
}
|
|
146
|
+
|
|
102
147
|
private ArrayDisplayInfo GetOrCreateArrayDisplayInfo(int componentInstanceId, SerializedProperty arraySerializedProperty, string propName, AirshipComponentPropertyType listType, SerializedProperty itemInfo) {
|
|
103
|
-
|
|
148
|
+
|
|
104
149
|
|
|
105
150
|
Type objType = null;
|
|
106
151
|
if (listType == AirshipComponentPropertyType.AirshipObject || listType == AirshipComponentPropertyType.AirshipComponent) {
|
|
107
152
|
objType = TypeReflection.GetTypeFromString(itemInfo.FindPropertyRelative("objectType").stringValue);
|
|
108
153
|
}
|
|
109
|
-
|
|
110
|
-
|
|
154
|
+
|
|
155
|
+
var seenArrayProps = GetOrCreateSeenArraysSet(componentInstanceId);
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
void BindReorderableListToProperty(ReorderableList reorderableList) {
|
|
111
159
|
var serializedArray = itemInfo.FindPropertyRelative("serializedItems");
|
|
112
160
|
var objectRefs = itemInfo.FindPropertyRelative("objectRefs");
|
|
113
|
-
var
|
|
161
|
+
var modified = arraySerializedProperty.FindPropertyRelative("modified");
|
|
114
162
|
|
|
115
|
-
|
|
116
|
-
|
|
163
|
+
reorderableList.elementHeight = EditorGUIUtility.singleLineHeight;
|
|
164
|
+
reorderableList.onRemoveCallback = (ReorderableList list) => {
|
|
117
165
|
if (list.selectedIndices.Count == 1) {
|
|
118
166
|
var deletedIndex = list.selectedIndices[0];
|
|
119
167
|
list.Deselect(deletedIndex);
|
|
@@ -123,25 +171,62 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
123
171
|
list.serializedProperty.DeleteArrayElementAtIndex(list.serializedProperty.arraySize - 1);
|
|
124
172
|
};
|
|
125
173
|
|
|
126
|
-
|
|
174
|
+
reorderableList.onAddCallback = (list) => {
|
|
175
|
+
list.serializedProperty.InsertArrayElementAtIndex(list.serializedProperty.arraySize);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
reorderableList.onChangedCallback = (ReorderableList list) => {
|
|
127
179
|
modified.boolValue = true;
|
|
128
180
|
// Match number of elements in inspector reorderable list to serialized objectRefs. This is to reconcile objectRefs
|
|
129
181
|
MatchReferenceArraySize(objectRefs, serializedArray);
|
|
130
182
|
};
|
|
131
183
|
|
|
132
|
-
|
|
184
|
+
reorderableList.onReorderCallbackWithDetails = (ReorderableList list, int oldIndex, int newIndex) => {
|
|
133
185
|
objectRefs.MoveArrayElement(oldIndex, newIndex);
|
|
134
186
|
};
|
|
135
187
|
|
|
136
|
-
|
|
188
|
+
reorderableList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => {
|
|
189
|
+
if (!serializedArray.isArray) {
|
|
190
|
+
EditorGUILayout.HelpBox("Is not array", MessageType.Error);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (index > serializedArray.arraySize - 1) {
|
|
195
|
+
EditorGUILayout.HelpBox("Element exceeds array size", MessageType.Error);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
|
|
137
199
|
RenderArrayElement(rect, arraySerializedProperty, itemInfo, index, listType, serializedArray.GetArrayElementAtIndex(index), modified, objectRefs, objType, out var errReason);
|
|
138
200
|
if (errReason.Length > 0) {
|
|
139
201
|
EditorGUI.LabelField(rect, $"{errReason}");
|
|
140
202
|
}
|
|
203
|
+
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
var serializedArray = itemInfo.FindPropertyRelative("serializedItems");
|
|
208
|
+
if (!_reorderableLists.TryGetValue((componentInstanceId, propName), out var displayInfo) || displayInfo.listType != listType || displayInfo.objType != objType) {
|
|
209
|
+
var newDisplayInfo = new ArrayDisplayInfo {
|
|
210
|
+
listType = listType,
|
|
211
|
+
objType = objType,
|
|
212
|
+
reorderableList = new ReorderableList(serializedObject, serializedArray, true, false, true, true),
|
|
141
213
|
};
|
|
214
|
+
|
|
215
|
+
BindReorderableListToProperty(newDisplayInfo.reorderableList);
|
|
216
|
+
|
|
217
|
+
seenArrayProps.Add(propName);
|
|
142
218
|
_reorderableLists[(componentInstanceId, propName)] = newDisplayInfo;
|
|
143
219
|
return newDisplayInfo;
|
|
144
220
|
}
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
if (displayInfo.IsArrayDataMismatched(serializedObject, serializedArray)) {
|
|
224
|
+
displayInfo.reorderableList =
|
|
225
|
+
new ReorderableList(serializedObject, serializedArray, true, false, true, true);
|
|
226
|
+
BindReorderableListToProperty(displayInfo.reorderableList);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
seenArrayProps.Add(propName);
|
|
145
230
|
return displayInfo;
|
|
146
231
|
}
|
|
147
232
|
|
|
@@ -397,11 +482,22 @@ public class ScriptBindingEditor : UnityEditor.Editor {
|
|
|
397
482
|
propertyList.Sort((p1, p2) =>
|
|
398
483
|
indexDictionary[p1.FindPropertyRelative("name").stringValue] > indexDictionary[p2.FindPropertyRelative("name").stringValue] ? 1 : -1
|
|
399
484
|
);
|
|
485
|
+
|
|
486
|
+
var componentInstanceId = binding.GetInstanceID();
|
|
487
|
+
|
|
488
|
+
// Keeping track of which array properties that have been seen
|
|
489
|
+
var seenArraysSet = GetOrCreateSeenArraysSet(componentInstanceId);
|
|
490
|
+
|
|
491
|
+
// We're running a new render, so haven't seen the arrays yet
|
|
492
|
+
seenArraysSet.Clear();
|
|
400
493
|
|
|
401
494
|
foreach (var prop in propertyList) {
|
|
402
|
-
DrawCustomProperty(
|
|
495
|
+
DrawCustomProperty(componentInstanceId, binding.script.m_metadata, prop);
|
|
403
496
|
}
|
|
404
497
|
|
|
498
|
+
// By the end of the render of the properties, all the arrays should have been populated
|
|
499
|
+
CleanupOrphanedArrayDisplayInfos(componentInstanceId);
|
|
500
|
+
|
|
405
501
|
#if AIRSHIP_DEBUG
|
|
406
502
|
AirshipEditorGUI.HorizontalLine();
|
|
407
503
|
EditorGUILayout.LabelField("Debug", EditorStyles.boldLabel);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEditor;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace Editor.Assets {
|
|
7
|
+
public class AudioAssetPostProcessor : AssetPostprocessor {
|
|
8
|
+
private static HashSet<string> processedClips = new HashSet<string>();
|
|
9
|
+
|
|
10
|
+
// todo: leaving this disabled for now. These are optimized settings for audio clips.
|
|
11
|
+
// private void OnPostprocessAudio(AudioClip clip) {
|
|
12
|
+
// var importer = (AudioImporter) assetImporter;
|
|
13
|
+
// if (processedClips.Contains(importer.assetPath)) return; // Already processed
|
|
14
|
+
//
|
|
15
|
+
// importer.loadInBackground = true;
|
|
16
|
+
//
|
|
17
|
+
// var audioImporterSampleSettings = new AudioImporterSampleSettings() {
|
|
18
|
+
// compressionFormat = AudioCompressionFormat.Vorbis,
|
|
19
|
+
// quality = 0.5f,
|
|
20
|
+
// };
|
|
21
|
+
// // For clips over 30s in length we compress in memory on mobile to keep memory lower
|
|
22
|
+
// if (clip.length > 30) {
|
|
23
|
+
// var mobileQuality = new AudioImporterSampleSettings() {
|
|
24
|
+
// loadType = AudioClipLoadType.CompressedInMemory,
|
|
25
|
+
// compressionFormat = AudioCompressionFormat.Vorbis,
|
|
26
|
+
// quality = 0.3f,
|
|
27
|
+
// };
|
|
28
|
+
// importer.SetOverrideSampleSettings(BuildTargetGroup.iOS, mobileQuality);
|
|
29
|
+
// importer.SetOverrideSampleSettings(BuildTargetGroup.Android, mobileQuality);
|
|
30
|
+
// }
|
|
31
|
+
// importer.defaultSampleSettings = audioImporterSampleSettings;
|
|
32
|
+
// processedClips.Add(importer.assetPath);
|
|
33
|
+
// importer.SaveAndReimport();
|
|
34
|
+
// }
|
|
35
|
+
}
|
|
36
|
+
}
|
package/Editor/BuildMenu.cs
CHANGED
|
@@ -114,6 +114,8 @@ namespace Editor {
|
|
|
114
114
|
OnBuild();
|
|
115
115
|
CreateAssetBundles.ResetScenes();
|
|
116
116
|
|
|
117
|
+
CreateAssetBundles.SwapToQualityLevel("Normal");
|
|
118
|
+
|
|
117
119
|
UserBuildSettings.architecture = OSArchitecture.x64ARM64;
|
|
118
120
|
PlayerSettings.SplashScreen.show = false;
|
|
119
121
|
|
|
@@ -160,6 +162,8 @@ namespace Editor {
|
|
|
160
162
|
OnBuild();
|
|
161
163
|
CreateAssetBundles.ResetScenes();
|
|
162
164
|
|
|
165
|
+
CreateAssetBundles.SwapToQualityLevel("Normal");
|
|
166
|
+
|
|
163
167
|
UserBuildSettings.architecture = OSArchitecture.x64ARM64;
|
|
164
168
|
PlayerSettings.SplashScreen.show = false;
|
|
165
169
|
PlayerSettings.SetScriptingBackend(NamedBuildTarget.Standalone, ScriptingImplementation.IL2CPP);
|
|
@@ -194,6 +198,8 @@ namespace Editor {
|
|
|
194
198
|
OnBuild();
|
|
195
199
|
CreateAssetBundles.ResetScenes();
|
|
196
200
|
|
|
201
|
+
CreateAssetBundles.SwapToQualityLevel("Low");
|
|
202
|
+
|
|
197
203
|
UserBuildSettings.architecture = OSArchitecture.x64ARM64;
|
|
198
204
|
PlayerSettings.SplashScreen.show = false;
|
|
199
205
|
PlayerSettings.SetScriptingBackend(NamedBuildTarget.iOS, ScriptingImplementation.IL2CPP);
|
|
@@ -210,7 +216,7 @@ namespace Editor {
|
|
|
210
216
|
options.extraScriptingDefines = extraDefines.ToArray();
|
|
211
217
|
|
|
212
218
|
if (development == true) {
|
|
213
|
-
options.options = BuildOptions.Development;
|
|
219
|
+
options.options = BuildOptions.Development | BuildOptions.ConnectWithProfiler;
|
|
214
220
|
}
|
|
215
221
|
|
|
216
222
|
var report = BuildPipeline.BuildPlayer(options);
|
|
@@ -233,13 +239,24 @@ namespace Editor {
|
|
|
233
239
|
#endif
|
|
234
240
|
}
|
|
235
241
|
|
|
236
|
-
public
|
|
242
|
+
public enum AndroidBuildType {
|
|
243
|
+
DevelopmentAPK,
|
|
244
|
+
ReleaseAPK,
|
|
245
|
+
ReleaseAAB,
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
public static void BuildAndroidClient(AndroidBuildType buildType) {
|
|
249
|
+
var development = buildType == AndroidBuildType.DevelopmentAPK;
|
|
250
|
+
var buildApk = buildType != AndroidBuildType.ReleaseAAB;
|
|
251
|
+
|
|
252
|
+
CreateAssetBundles.SwapToQualityLevel("Low");
|
|
253
|
+
|
|
237
254
|
OnBuild();
|
|
238
255
|
CreateAssetBundles.ResetScenes();
|
|
239
256
|
|
|
240
257
|
PlayerSettings.SplashScreen.show = false;
|
|
241
258
|
PlayerSettings.SetScriptingBackend(NamedBuildTarget.Android, ScriptingImplementation.IL2CPP);
|
|
242
|
-
PlayerSettings.Android.splitApplicationBinary = !
|
|
259
|
+
PlayerSettings.Android.splitApplicationBinary = !buildApk;
|
|
243
260
|
|
|
244
261
|
BuildProfile buildProfile;
|
|
245
262
|
if (development) {
|
|
@@ -255,9 +272,9 @@ namespace Editor {
|
|
|
255
272
|
buildProfile.overrideGlobalScenes = true;
|
|
256
273
|
buildProfile.scenes = editorBuildScenes.ToArray();
|
|
257
274
|
options.buildProfile = buildProfile;
|
|
258
|
-
options.locationPathName = $"build/client_android/{ClientExecutableName}.{(
|
|
275
|
+
options.locationPathName = $"build/client_android/{ClientExecutableName}.{(buildApk ? "apk" : "aab")}";
|
|
259
276
|
if (development) {
|
|
260
|
-
options.options = BuildOptions.Development;
|
|
277
|
+
options.options = BuildOptions.Development | BuildOptions.ConnectWithProfiler;
|
|
261
278
|
}
|
|
262
279
|
|
|
263
280
|
var report = BuildPipeline.BuildPlayer(options);
|
|
@@ -303,14 +320,25 @@ namespace Editor {
|
|
|
303
320
|
BuildIOSClient(false, true);
|
|
304
321
|
}
|
|
305
322
|
|
|
306
|
-
[MenuItem("Airship/Create Binary/Client/
|
|
323
|
+
[MenuItem("Airship/Create Binary/Client/iOS (Staging Development)", priority = 80)]
|
|
324
|
+
public static void BuildIOSClientStagingDevelopmentMenuItem() {
|
|
325
|
+
Debug.Log("Building iOS staging development client..");
|
|
326
|
+
BuildIOSClient(true, true);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
[MenuItem("Airship/Create Binary/Client/Android (Google Play)", priority = 80)]
|
|
307
330
|
public static void BuildAndroidClientMenuItem() {
|
|
308
|
-
BuildAndroidClient(
|
|
331
|
+
BuildAndroidClient(AndroidBuildType.ReleaseAAB);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
[MenuItem("Airship/Create Binary/Client/Android (APK)", priority = 80)]
|
|
335
|
+
public static void BuildAndroidProdAPK() {
|
|
336
|
+
BuildAndroidClient(AndroidBuildType.ReleaseAPK);
|
|
309
337
|
}
|
|
310
338
|
|
|
311
|
-
[MenuItem("Airship/Create Binary/Client/Android (Development)", priority = 80)]
|
|
339
|
+
[MenuItem("Airship/Create Binary/Client/Android (Development APK)", priority = 80)]
|
|
312
340
|
public static void BuildAndroidDevelopmentClientMenuItem() {
|
|
313
|
-
BuildAndroidClient(
|
|
341
|
+
BuildAndroidClient(AndroidBuildType.DevelopmentAPK);
|
|
314
342
|
}
|
|
315
343
|
#endif
|
|
316
344
|
|
|
@@ -327,6 +355,8 @@ namespace Editor {
|
|
|
327
355
|
OnBuild();
|
|
328
356
|
CreateAssetBundles.ResetScenes();
|
|
329
357
|
|
|
358
|
+
CreateAssetBundles.SwapToQualityLevel("Normal");
|
|
359
|
+
|
|
330
360
|
PlayerSettings.SplashScreen.show = false;
|
|
331
361
|
PlayerSettings.SetScriptingBackend(NamedBuildTarget.Standalone, ScriptingImplementation.IL2CPP);
|
|
332
362
|
var options = new BuildPlayerOptions();
|
|
@@ -5,7 +5,6 @@ using System.IO;
|
|
|
5
5
|
using System.Linq;
|
|
6
6
|
using Code.Bootstrap;
|
|
7
7
|
using Editor.Packages;
|
|
8
|
-
using Luau;
|
|
9
8
|
using UnityEditor.Build.Pipeline;
|
|
10
9
|
using UnityEditor.Build.Pipeline.Interfaces;
|
|
11
10
|
using UnityEditor.Build.Pipeline.Tasks;
|
|
@@ -13,6 +12,7 @@ using UnityEngine;
|
|
|
13
12
|
using UnityEngine.Rendering;
|
|
14
13
|
#if UNITY_EDITOR
|
|
15
14
|
using UnityEditor;
|
|
15
|
+
using Editor.Quality;
|
|
16
16
|
#endif
|
|
17
17
|
using UnityEngine.SceneManagement;
|
|
18
18
|
using Debug = UnityEngine.Debug;
|
|
@@ -294,6 +294,12 @@ public static class CreateAssetBundles {
|
|
|
294
294
|
Debug.Log($"[Editor]: Building {platform} asset bundles...");
|
|
295
295
|
Debug.Log("[Editor]: Build path: " + buildPath);
|
|
296
296
|
|
|
297
|
+
if (platform == AirshipPlatform.iOS || platform == AirshipPlatform.Android) {
|
|
298
|
+
SwapToQualityLevel("Low");
|
|
299
|
+
} else {
|
|
300
|
+
SwapToQualityLevel("Normal");
|
|
301
|
+
}
|
|
302
|
+
|
|
297
303
|
// Act as if we are building all asset bundles (including CoreMaterials).
|
|
298
304
|
// This is so our current build target will have references to those asset bundles.
|
|
299
305
|
// This is paired with changes to Scriptable Build Pipeline that prevent these bundles from actually being built.
|
|
@@ -486,6 +492,24 @@ public static class CreateAssetBundles {
|
|
|
486
492
|
return true;
|
|
487
493
|
}
|
|
488
494
|
|
|
495
|
+
public static void SwapToQualityLevel(string name) {
|
|
496
|
+
#if UNITY_EDITOR
|
|
497
|
+
if (name == "Low") {
|
|
498
|
+
QualityConfig.ConfigureLowQualityLevel();
|
|
499
|
+
} else if (name == "Normal") {
|
|
500
|
+
QualityConfig.ConfigureNormalQualityLevel();
|
|
501
|
+
}
|
|
502
|
+
#endif
|
|
503
|
+
|
|
504
|
+
int index = System.Array.IndexOf(QualitySettings.names, name);
|
|
505
|
+
if (index < 0) {
|
|
506
|
+
Debug.LogError($"Quality level '{name}' not found. Please report this issue to Airship devs.");
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
QualitySettings.SetQualityLevel(index, applyExpensiveChanges: true);
|
|
511
|
+
}
|
|
512
|
+
|
|
489
513
|
static IList<IBuildTask> GetBuildTasks()
|
|
490
514
|
{
|
|
491
515
|
var buildTasks = new List<IBuildTask>();
|
|
@@ -28,6 +28,7 @@ using UnityEngine.Rendering;
|
|
|
28
28
|
using Debug = UnityEngine.Debug;
|
|
29
29
|
using Object = UnityEngine.Object;
|
|
30
30
|
using ZipFile = Unity.VisualScripting.IonicZip.ZipFile;
|
|
31
|
+
// ReSharper disable ReplaceWithSingleAssignment.True
|
|
31
32
|
|
|
32
33
|
namespace Editor.Packages {
|
|
33
34
|
public class AirshipPackagesWindow : EditorWindow {
|
|
@@ -416,6 +417,7 @@ namespace Editor.Packages {
|
|
|
416
417
|
// Act as if we are building all asset bundles (including CoreMaterials).
|
|
417
418
|
// This is so our current build target will have references to those asset bundles.
|
|
418
419
|
// This is paired with changes to Scriptable Build Pipeline that prevent these bundles from actually being built.
|
|
420
|
+
|
|
419
421
|
var compileUrpShaders = true;
|
|
420
422
|
if (packageDoc.id.ToLower() == "@easy/core") {
|
|
421
423
|
compileUrpShaders = false;
|
|
@@ -448,6 +450,12 @@ namespace Editor.Packages {
|
|
|
448
450
|
});
|
|
449
451
|
}
|
|
450
452
|
|
|
453
|
+
if (platform == AirshipPlatform.iOS || platform == AirshipPlatform.Android) {
|
|
454
|
+
CreateAssetBundles.SwapToQualityLevel("Mobile");
|
|
455
|
+
} else {
|
|
456
|
+
CreateAssetBundles.SwapToQualityLevel("Normal");
|
|
457
|
+
}
|
|
458
|
+
|
|
451
459
|
var buildParams = new BundleBuildParameters(
|
|
452
460
|
buildTarget,
|
|
453
461
|
buildTargetGroup,
|