gg.easy.airship 0.1.2170 → 0.1.2172
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 +37 -9
- package/Editor/CreateAssetBundles.cs +25 -1
- package/Editor/Packages/AirshipPackagesWindow.cs +13 -1
- package/Editor/Quality/QualityConfig.cs +203 -0
- package/Editor/Quality/QualityConfig.cs.meta +3 -0
- package/Editor/Quality.meta +3 -0
- package/Editor/TypescriptServices/Editor/TypescriptLogService.cs +41 -30
- package/Editor/Util/AirshipEditorUtil.cs +1 -1
- package/Runtime/Code/AirshipConst.cs +3 -2
- 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/CoreUI/Login/LoginApp.cs +13 -3
- package/Runtime/Code/GameConfig/GameConfig.cs +3 -0
- package/Runtime/Code/Luau/AirshipComponent.cs +2 -1
- package/Runtime/Code/Luau/LuauCompiler.cs +2 -1
- package/Runtime/Code/Luau/LuauCore.cs +5 -0
- package/Runtime/Code/Luau/LuauCoreCallbacks.cs +11 -10
- package/Runtime/Code/Luau/LuauMetadataPropertySerializer.cs +10 -7
- package/Runtime/Code/Luau/LuauPlugin.cs +28 -2
- package/Runtime/Code/Luau/LuauState.cs +4 -0
- package/Runtime/Code/Luau/ThreadManager.cs +9 -0
- package/Runtime/Code/LuauAPI/Bridge.cs +11 -0
- package/Runtime/Code/Network/Simulation/AirshipNetworkedObject.cs +25 -13
- package/Runtime/Code/Network/Simulation/AirshipSimulationManager.cs +0 -3
- package/Runtime/Code/Network/StateSystem/AirshipNetworkedStateManager.cs +0 -1
- package/Runtime/Code/Player/Character/Animation/CharacterAnimationHelper.cs +81 -108
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterAnimationSyncData.cs +12 -12
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterMovement.cs +166 -109
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterMovementSettings.cs +1 -7
- package/Runtime/Code/Player/Character/MovementSystems/Character/CharacterPhysics.cs +5 -4
- 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/VoxelCompressUtil.cs +3 -1
- package/Runtime/Code/VoxelWorld/VoxelWorld.cs +74 -84
- package/Runtime/Code/VoxelWorld/VoxelWorldChunk.cs +10 -7
- package/Runtime/Code/VoxelWorld/WorldSaveFile.cs +77 -26
- 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 +7 -7
- 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 +516 -338
- package/Runtime/Scenes/MainMenu.unity +48 -2
- package/ScriptableBuildPipeline/Editor/Tasks/ArchiveAndCompressBundles.cs +1 -1
- package/ThirdParty/Agones/AgonesSdk.cs +6 -5
- 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
|
@@ -160,6 +160,8 @@ namespace Editor {
|
|
|
160
160
|
OnBuild();
|
|
161
161
|
CreateAssetBundles.ResetScenes();
|
|
162
162
|
|
|
163
|
+
CreateAssetBundles.SwapToQualityLevel("Normal");
|
|
164
|
+
|
|
163
165
|
UserBuildSettings.architecture = OSArchitecture.x64ARM64;
|
|
164
166
|
PlayerSettings.SplashScreen.show = false;
|
|
165
167
|
PlayerSettings.SetScriptingBackend(NamedBuildTarget.Standalone, ScriptingImplementation.IL2CPP);
|
|
@@ -194,6 +196,8 @@ namespace Editor {
|
|
|
194
196
|
OnBuild();
|
|
195
197
|
CreateAssetBundles.ResetScenes();
|
|
196
198
|
|
|
199
|
+
CreateAssetBundles.SwapToQualityLevel("Low");
|
|
200
|
+
|
|
197
201
|
UserBuildSettings.architecture = OSArchitecture.x64ARM64;
|
|
198
202
|
PlayerSettings.SplashScreen.show = false;
|
|
199
203
|
PlayerSettings.SetScriptingBackend(NamedBuildTarget.iOS, ScriptingImplementation.IL2CPP);
|
|
@@ -210,7 +214,7 @@ namespace Editor {
|
|
|
210
214
|
options.extraScriptingDefines = extraDefines.ToArray();
|
|
211
215
|
|
|
212
216
|
if (development == true) {
|
|
213
|
-
options.options = BuildOptions.Development;
|
|
217
|
+
options.options = BuildOptions.Development | BuildOptions.ConnectWithProfiler;
|
|
214
218
|
}
|
|
215
219
|
|
|
216
220
|
var report = BuildPipeline.BuildPlayer(options);
|
|
@@ -233,13 +237,24 @@ namespace Editor {
|
|
|
233
237
|
#endif
|
|
234
238
|
}
|
|
235
239
|
|
|
236
|
-
public
|
|
240
|
+
public enum AndroidBuildType {
|
|
241
|
+
DevelopmentAPK,
|
|
242
|
+
ReleaseAPK,
|
|
243
|
+
ReleaseAAB,
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
public static void BuildAndroidClient(AndroidBuildType buildType) {
|
|
247
|
+
var development = buildType == AndroidBuildType.DevelopmentAPK;
|
|
248
|
+
var buildApk = buildType != AndroidBuildType.ReleaseAAB;
|
|
249
|
+
|
|
250
|
+
CreateAssetBundles.SwapToQualityLevel("Low");
|
|
251
|
+
|
|
237
252
|
OnBuild();
|
|
238
253
|
CreateAssetBundles.ResetScenes();
|
|
239
254
|
|
|
240
255
|
PlayerSettings.SplashScreen.show = false;
|
|
241
256
|
PlayerSettings.SetScriptingBackend(NamedBuildTarget.Android, ScriptingImplementation.IL2CPP);
|
|
242
|
-
PlayerSettings.Android.splitApplicationBinary = !
|
|
257
|
+
PlayerSettings.Android.splitApplicationBinary = !buildApk;
|
|
243
258
|
|
|
244
259
|
BuildProfile buildProfile;
|
|
245
260
|
if (development) {
|
|
@@ -255,9 +270,9 @@ namespace Editor {
|
|
|
255
270
|
buildProfile.overrideGlobalScenes = true;
|
|
256
271
|
buildProfile.scenes = editorBuildScenes.ToArray();
|
|
257
272
|
options.buildProfile = buildProfile;
|
|
258
|
-
options.locationPathName = $"build/client_android/{ClientExecutableName}.{(
|
|
273
|
+
options.locationPathName = $"build/client_android/{ClientExecutableName}.{(buildApk ? "apk" : "aab")}";
|
|
259
274
|
if (development) {
|
|
260
|
-
options.options = BuildOptions.Development;
|
|
275
|
+
options.options = BuildOptions.Development | BuildOptions.ConnectWithProfiler;
|
|
261
276
|
}
|
|
262
277
|
|
|
263
278
|
var report = BuildPipeline.BuildPlayer(options);
|
|
@@ -303,14 +318,25 @@ namespace Editor {
|
|
|
303
318
|
BuildIOSClient(false, true);
|
|
304
319
|
}
|
|
305
320
|
|
|
306
|
-
[MenuItem("Airship/Create Binary/Client/
|
|
321
|
+
[MenuItem("Airship/Create Binary/Client/iOS (Staging Development)", priority = 80)]
|
|
322
|
+
public static void BuildIOSClientStagingDevelopmentMenuItem() {
|
|
323
|
+
Debug.Log("Building iOS staging development client..");
|
|
324
|
+
BuildIOSClient(true, true);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
[MenuItem("Airship/Create Binary/Client/Android (Google Play)", priority = 80)]
|
|
307
328
|
public static void BuildAndroidClientMenuItem() {
|
|
308
|
-
BuildAndroidClient(
|
|
329
|
+
BuildAndroidClient(AndroidBuildType.ReleaseAAB);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
[MenuItem("Airship/Create Binary/Client/Android (APK)", priority = 80)]
|
|
333
|
+
public static void BuildAndroidProdAPK() {
|
|
334
|
+
BuildAndroidClient(AndroidBuildType.ReleaseAPK);
|
|
309
335
|
}
|
|
310
336
|
|
|
311
|
-
[MenuItem("Airship/Create Binary/Client/Android (Development)", priority = 80)]
|
|
337
|
+
[MenuItem("Airship/Create Binary/Client/Android (Development APK)", priority = 80)]
|
|
312
338
|
public static void BuildAndroidDevelopmentClientMenuItem() {
|
|
313
|
-
BuildAndroidClient(
|
|
339
|
+
BuildAndroidClient(AndroidBuildType.DevelopmentAPK);
|
|
314
340
|
}
|
|
315
341
|
#endif
|
|
316
342
|
|
|
@@ -327,6 +353,8 @@ namespace Editor {
|
|
|
327
353
|
OnBuild();
|
|
328
354
|
CreateAssetBundles.ResetScenes();
|
|
329
355
|
|
|
356
|
+
CreateAssetBundles.SwapToQualityLevel("Normal");
|
|
357
|
+
|
|
330
358
|
PlayerSettings.SplashScreen.show = false;
|
|
331
359
|
PlayerSettings.SetScriptingBackend(NamedBuildTarget.Standalone, ScriptingImplementation.IL2CPP);
|
|
332
360
|
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,7 +417,12 @@ 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.
|
|
419
|
-
|
|
420
|
+
|
|
421
|
+
var compileUrpShaders = true;
|
|
422
|
+
if (packageDoc.id.ToLower() == "@easy/core") {
|
|
423
|
+
compileUrpShaders = false;
|
|
424
|
+
}
|
|
425
|
+
List<AssetBundleBuild> builds = CreateAssetBundles.GetPackageAssetBundleBuilds(compileUrpShaders);
|
|
420
426
|
|
|
421
427
|
foreach (var platform in platforms) {
|
|
422
428
|
var st = Stopwatch.StartNew();
|
|
@@ -444,6 +450,12 @@ namespace Editor.Packages {
|
|
|
444
450
|
});
|
|
445
451
|
}
|
|
446
452
|
|
|
453
|
+
if (platform == AirshipPlatform.iOS || platform == AirshipPlatform.Android) {
|
|
454
|
+
CreateAssetBundles.SwapToQualityLevel("Mobile");
|
|
455
|
+
} else {
|
|
456
|
+
CreateAssetBundles.SwapToQualityLevel("Normal");
|
|
457
|
+
}
|
|
458
|
+
|
|
447
459
|
var buildParams = new BundleBuildParameters(
|
|
448
460
|
buildTarget,
|
|
449
461
|
buildTargetGroup,
|