gg.easy.airship 0.1.2103 → 0.1.2105
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/AccessoryEditorWindow.cs +37 -28
- package/Editor/Accessories/Clothing/PlatformGearBundleManifestEditor.cs +3 -2
- package/Editor/AirAsset/AirAssetBundleEditor.cs +225 -0
- package/Editor/AirAsset/AirAssetBundleEditor.cs.meta +3 -0
- package/Editor/AirAsset.meta +3 -0
- package/Editor/EditorIntegrationsConfig.cs +1 -1
- package/Editor/Publish/Deploy.cs +16 -5
- package/Editor/TypescriptCompiler~/utsc.js +140 -140
- package/Editor/TypescriptServices/Compiler/TypescriptCompilationService.cs +97 -42
- package/Editor/TypescriptServices/Editor/TypescriptOptions.cs +105 -38
- package/Editor/TypescriptServices/Projects/TypescriptProject.cs +2 -0
- package/Editor/TypescriptServices/TypescriptServices.cs +1 -0
- package/Resources/Fonts/Roboto/Roboto-Regular SDF.asset +779 -17
- package/Runtime/Code/Accessories/Clothing/PlatformGear.cs +1 -1
- package/Runtime/Code/AirAssetBundle/AirAssetBundle.cs +95 -0
- package/Runtime/Code/AirAssetBundle/AirAssetBundle.cs.meta +3 -0
- package/Runtime/Code/AirAssetBundle.meta +3 -0
- package/Runtime/Code/LuauAPI/MinMaxGradientAPI.cs +9 -0
- package/Runtime/Code/LuauAPI/MinMaxGradientAPI.cs.meta +3 -0
- package/Runtime/Code/Player/Accessories/AccessoryBuilder.cs +3 -3
- package/Runtime/Code/Player/Accessories/AccessoryComponent.cs +7 -0
- package/Runtime/Code/VoxelWorld/ChunkSerializer.cs +1 -0
- package/Runtime/Code/VoxelWorld/VoxelBlockDefinitionList.cs +37 -11
- package/Runtime/Code/VoxelWorld/VoxelWorld.cs +10 -0
- package/Runtime/Code/VoxelWorld/VoxelWorldChunk.cs +103 -5
- package/Runtime/Code/VoxelWorld/WorldSaveFile.cs +2 -0
- package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/Info.plist.meta +7 -0
- package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/MacOS.meta +8 -0
- package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/_CodeSignature/CodeResources.meta +7 -0
- package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents/_CodeSignature.meta +8 -0
- package/Runtime/Plugins/Mac/LuauPlugin.bundle/Contents.meta +8 -0
- package/ThirdParty/UnityTweens/Runtime/AirshipTweenExtensions.cs +11 -0
- package/URP/AirshipURPAssetBaked.asset +1 -1
- package/URP/AirshipURPAsset_Renderer.asset +34 -37
- package/URP/Shaders/AirshipCharacterAlpha.shader +95 -0
- package/URP/Shaders/AirshipCharacterAlpha.shader.meta +9 -0
- package/URP/Shaders/AirshipCharacterBehindWalls.shader +59 -0
- package/URP/Shaders/AirshipCharacterBehindWalls.shader.meta +9 -0
- package/URP/Shaders/AirshipCharacterStencil.shader +19 -0
- package/URP/Shaders/AirshipCharacterStencil.shader.meta +9 -0
- package/URP/Shaders/CharacterOverlayAlpha.mat +167 -0
- package/URP/Shaders/CharacterOverlayAlpha.mat.meta +8 -0
- package/URP/Shaders/CharacterOverlayBehindWalls.mat +167 -0
- package/URP/Shaders/CharacterOverlayBehindWalls.mat.meta +8 -0
- package/URP/Shaders/CharacterOverlayStencil.mat +167 -0
- package/URP/Shaders/CharacterOverlayStencil.mat.meta +8 -0
- package/URP/Shaders.meta +8 -0
- package/package.json +1 -1
|
@@ -34,8 +34,8 @@ namespace Editor.Accessories {
|
|
|
34
34
|
private AccessoryPrefabEditor prefabEditor;
|
|
35
35
|
private GameObject characterGO;
|
|
36
36
|
List<AccessoryComponent> allAccessories = new List<AccessoryComponent>();
|
|
37
|
-
private AccessoryComponent
|
|
38
|
-
private AccessoryComponent
|
|
37
|
+
private AccessoryComponent editingAccessoryComponent;
|
|
38
|
+
private AccessoryComponent referenceAccessoryComponent;
|
|
39
39
|
private ListView _listPane;
|
|
40
40
|
|
|
41
41
|
private Label _selectedItemLabel;
|
|
@@ -57,8 +57,8 @@ namespace Editor.Accessories {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
_prefabStage = null;
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
editingAccessoryComponent = null;
|
|
61
|
+
referenceAccessoryComponent = null;
|
|
62
62
|
|
|
63
63
|
if (characterGO) {
|
|
64
64
|
DestroyImmediate(characterGO);
|
|
@@ -130,7 +130,7 @@ namespace Editor.Accessories {
|
|
|
130
130
|
saveBtn.text = "Save";
|
|
131
131
|
buttonPanel.Add(saveBtn);
|
|
132
132
|
saveBtn.clickable.clicked += () => {
|
|
133
|
-
if (
|
|
133
|
+
if (editingAccessoryComponent == null || referenceAccessoryComponent == null) return;
|
|
134
134
|
SaveCurrentAccessory();
|
|
135
135
|
};
|
|
136
136
|
|
|
@@ -139,7 +139,7 @@ namespace Editor.Accessories {
|
|
|
139
139
|
resetBtn.text = "Reset";
|
|
140
140
|
buttonPanel.Add(resetBtn);
|
|
141
141
|
resetBtn.clickable.clicked += () => {
|
|
142
|
-
if (
|
|
142
|
+
if (editingAccessoryComponent == null || referenceAccessoryComponent == null) return;
|
|
143
143
|
ResetCurrentAccessory();
|
|
144
144
|
};
|
|
145
145
|
|
|
@@ -219,9 +219,9 @@ namespace Editor.Accessories {
|
|
|
219
219
|
|
|
220
220
|
private void ClearCurrentAccessory() {
|
|
221
221
|
Log("ClearCurrentAccessory");
|
|
222
|
-
if (
|
|
223
|
-
DestroyImmediate(
|
|
224
|
-
|
|
222
|
+
if (editingAccessoryComponent) {
|
|
223
|
+
DestroyImmediate(editingAccessoryComponent.gameObject);
|
|
224
|
+
editingAccessoryComponent = null;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
if (_selectedItemLabel != null) {
|
|
@@ -229,9 +229,11 @@ namespace Editor.Accessories {
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
+
|
|
233
|
+
private bool hasFramedView = false;
|
|
232
234
|
private void BuildScene(AccessoryComponent accessoryComponent, bool forceRedraw = false) {
|
|
233
|
-
var newItem = accessoryComponent !=
|
|
234
|
-
Log("Building Scene. New Item: " + newItem + " acc: " + accessoryComponent?.gameObject.name + " oldAcc: " +
|
|
235
|
+
var newItem = accessoryComponent != referenceAccessoryComponent;
|
|
236
|
+
Log("Building Scene. New Item: " + newItem + " acc: " + accessoryComponent?.gameObject.name + " oldAcc: " + referenceAccessoryComponent?.gameObject.name);
|
|
235
237
|
if (_prefabStage == null || characterGO == null) {
|
|
236
238
|
CreateStage();
|
|
237
239
|
}
|
|
@@ -252,17 +254,24 @@ namespace Editor.Accessories {
|
|
|
252
254
|
return;
|
|
253
255
|
}
|
|
254
256
|
|
|
255
|
-
|
|
256
257
|
var go = (GameObject)PrefabUtility.InstantiatePrefab(accessoryComponent.gameObject, parent);
|
|
257
258
|
if (go != null) {
|
|
258
|
-
|
|
259
|
-
|
|
259
|
+
this.editingAccessoryComponent = go.GetComponent<AccessoryComponent>();
|
|
260
|
+
this.referenceAccessoryComponent = accessoryComponent;
|
|
260
261
|
//accessoryComponent.gameObject.hideFlags = HideFlags.DontSave;
|
|
261
262
|
Selection.activeObject = go;
|
|
262
263
|
Selection.activeGameObject = go;
|
|
263
|
-
SceneView.FrameLastActiveSceneView();
|
|
264
|
+
// SceneView.FrameLastActiveSceneView();
|
|
264
265
|
|
|
265
266
|
_selectedItemLabel.text = accessoryComponent.name;
|
|
267
|
+
|
|
268
|
+
if (this.editingAccessoryComponent.skinnedToCharacter) {
|
|
269
|
+
var skinnedMeshRenderers = go.GetComponentsInChildren<SkinnedMeshRenderer>();
|
|
270
|
+
foreach (var skinnedMeshRenderer in skinnedMeshRenderers) {
|
|
271
|
+
skinnedMeshRenderer.rootBone = rig.bodyMesh.rootBone;
|
|
272
|
+
skinnedMeshRenderer.bones = rig.bodyMesh.bones;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
266
275
|
}
|
|
267
276
|
}
|
|
268
277
|
}
|
|
@@ -366,30 +375,30 @@ namespace Editor.Accessories {
|
|
|
366
375
|
}
|
|
367
376
|
|
|
368
377
|
private void SaveCurrentAccessory() {
|
|
369
|
-
if (!
|
|
378
|
+
if (!referenceAccessoryComponent) {
|
|
370
379
|
Debug.LogError("Trying to save with an empty accessory component");
|
|
371
380
|
return;
|
|
372
381
|
}
|
|
373
382
|
|
|
374
|
-
Log("Saving acc: " +
|
|
375
|
-
Undo.RecordObject(
|
|
376
|
-
|
|
377
|
-
PrefabUtility.RecordPrefabInstancePropertyModifications(
|
|
378
|
-
EditorUtility.SetDirty(
|
|
379
|
-
PrefabUtility.ApplyPrefabInstance(
|
|
383
|
+
Log("Saving acc: " + referenceAccessoryComponent.gameObject.name);
|
|
384
|
+
Undo.RecordObject(referenceAccessoryComponent, "Save Accessory");
|
|
385
|
+
referenceAccessoryComponent.Copy(editingAccessoryComponent);
|
|
386
|
+
PrefabUtility.RecordPrefabInstancePropertyModifications(referenceAccessoryComponent);
|
|
387
|
+
EditorUtility.SetDirty(referenceAccessoryComponent);
|
|
388
|
+
PrefabUtility.ApplyPrefabInstance(editingAccessoryComponent.gameObject, InteractionMode.UserAction);
|
|
380
389
|
AssetDatabase.SaveAssets();
|
|
381
390
|
}
|
|
382
391
|
|
|
383
392
|
private void ResetCurrentAccessory() {
|
|
384
|
-
if(!
|
|
393
|
+
if(!referenceAccessoryComponent){
|
|
385
394
|
Debug.LogError("Trying to reset an empty accessory component");
|
|
386
395
|
return;
|
|
387
396
|
}
|
|
388
|
-
Log("Resetting acc: " +
|
|
389
|
-
Undo.RecordObject(
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
PrefabUtility.RevertPrefabInstance(
|
|
397
|
+
Log("Resetting acc: " + referenceAccessoryComponent.gameObject.name);
|
|
398
|
+
Undo.RecordObject(editingAccessoryComponent.transform, "ResetTransform");
|
|
399
|
+
editingAccessoryComponent.transform.SetLocalPositionAndRotation(referenceAccessoryComponent.localPosition, referenceAccessoryComponent.localRotation);
|
|
400
|
+
editingAccessoryComponent.localScale = referenceAccessoryComponent.localScale;
|
|
401
|
+
PrefabUtility.RevertPrefabInstance(editingAccessoryComponent.gameObject, InteractionMode.UserAction);
|
|
393
402
|
}
|
|
394
403
|
|
|
395
404
|
private void SetPose(PoseType poseType){
|
|
@@ -224,7 +224,8 @@ namespace Editor.Accessories.Clothing {
|
|
|
224
224
|
category = category,
|
|
225
225
|
subcategory = subcategory,
|
|
226
226
|
};
|
|
227
|
-
var
|
|
227
|
+
var url = $"{AirshipPlatformUrl.contentService}/gear/class-id/{gear.classId}";
|
|
228
|
+
var req = UnityWebRequest.Put(url,
|
|
228
229
|
JsonUtility.ToJson(data));
|
|
229
230
|
req.method = "PATCH";
|
|
230
231
|
req.SetRequestHeader("Content-Type","application/json");
|
|
@@ -232,7 +233,7 @@ namespace Editor.Accessories.Clothing {
|
|
|
232
233
|
req.SetRequestHeader("x-airship-ignore-rate-limit", "true");
|
|
233
234
|
await req.SendWebRequest();
|
|
234
235
|
if (req.result != UnityWebRequest.Result.Success) {
|
|
235
|
-
Debug.LogError("patch classId
|
|
236
|
+
Debug.LogError($"patch classId. url: {url}, response: {req.downloadHandler.text}, authToken: {InternalHttpManager.editorAuthToken}");
|
|
236
237
|
return;
|
|
237
238
|
}
|
|
238
239
|
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using System.Diagnostics;
|
|
3
|
+
using System.IO;
|
|
4
|
+
using System.Linq;
|
|
5
|
+
using System.Threading.Tasks;
|
|
6
|
+
using Code.Accessories.Clothing;
|
|
7
|
+
using Code.AirAssetBundle;
|
|
8
|
+
using Code.Bootstrap;
|
|
9
|
+
using Code.Http.Internal;
|
|
10
|
+
using Code.Platform.Shared;
|
|
11
|
+
using Editor.Accessories.Clothing;
|
|
12
|
+
using Editor.Packages;
|
|
13
|
+
using UnityEditor;
|
|
14
|
+
using UnityEditor.Build.Pipeline;
|
|
15
|
+
using UnityEngine;
|
|
16
|
+
using UnityEngine.Networking;
|
|
17
|
+
using Debug = UnityEngine.Debug;
|
|
18
|
+
|
|
19
|
+
namespace Editor.AirAsset {
|
|
20
|
+
[CustomEditor(typeof(AirAssetBundle))]
|
|
21
|
+
[CanEditMultipleObjects]
|
|
22
|
+
public class AirAssetBundleEditor : UnityEditor.Editor {
|
|
23
|
+
private static string easyOrgId = "6b62d6e3-9d74-449c-aeac-b4feed2012b1";
|
|
24
|
+
private bool skipBuild = false;
|
|
25
|
+
|
|
26
|
+
private void OnEnable() {
|
|
27
|
+
skipBuild = false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public override void OnInspectorGUI() {
|
|
31
|
+
base.DrawDefaultInspector();
|
|
32
|
+
|
|
33
|
+
GUILayout.Space(20);
|
|
34
|
+
AirshipEditorGUI.HorizontalLine();
|
|
35
|
+
GUILayout.Space(20);
|
|
36
|
+
|
|
37
|
+
if (GUILayout.Button("Publish")) {
|
|
38
|
+
this.BuildAllPlatforms();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
GUILayout.Space(10);
|
|
42
|
+
this.skipBuild = EditorGUILayout.Toggle("Skip Build", this.skipBuild);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
private async void BuildAllPlatforms() {
|
|
46
|
+
var st = Stopwatch.StartNew();
|
|
47
|
+
bool success = true;
|
|
48
|
+
|
|
49
|
+
List<AirshipPlatform> platforms = new();
|
|
50
|
+
platforms.AddRange(AirshipPlatformUtil.livePlatforms);
|
|
51
|
+
// platforms.Add(AirshipPlatform.Mac); // debug
|
|
52
|
+
|
|
53
|
+
// ********************************* //
|
|
54
|
+
var airAssetBundle = (AirAssetBundle)this.target;
|
|
55
|
+
|
|
56
|
+
if (!CreateAssetBundles.PrePublishChecks()) return;
|
|
57
|
+
|
|
58
|
+
string airId = airAssetBundle.airId;
|
|
59
|
+
|
|
60
|
+
var contentName = airAssetBundle.name;
|
|
61
|
+
var contentDescription = "Air Asset Bundle";
|
|
62
|
+
|
|
63
|
+
if (string.IsNullOrEmpty(airId)) {
|
|
64
|
+
// Create new air asset
|
|
65
|
+
var req = UnityWebRequest.PostWwwForm(
|
|
66
|
+
AirshipPlatformUrl.deploymentService + $"/air-assets/owner-type/ORGANIZATION/owner-id/{easyOrgId}",
|
|
67
|
+
JsonUtility.ToJson(new AirAssetCreateRequest() {
|
|
68
|
+
contentType = "application/airasset",
|
|
69
|
+
contentLength = 1,
|
|
70
|
+
name = contentName,
|
|
71
|
+
description = contentDescription,
|
|
72
|
+
platforms = platforms.Select((p) => AirshipPlatformUtil.GetStringName(p)).ToArray(),
|
|
73
|
+
}));
|
|
74
|
+
req.SetRequestHeader("Authorization", "Bearer " + InternalHttpManager.editorAuthToken);
|
|
75
|
+
await req.SendWebRequest();
|
|
76
|
+
Debug.Log("create response: " + req.downloadHandler.text);
|
|
77
|
+
var data = JsonUtility.FromJson<AirAssetCreateResponse>(req.downloadHandler.text);
|
|
78
|
+
airAssetBundle.airId = data.airAssetId;
|
|
79
|
+
EditorUtility.SetDirty(this.target);
|
|
80
|
+
this.SaveChanges();
|
|
81
|
+
airId = data.airAssetId;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
List<string> bundlePaths = new();
|
|
85
|
+
foreach (var platform in platforms) {
|
|
86
|
+
var path = await this.BuildPlatform(platform, airId);
|
|
87
|
+
if (string.IsNullOrEmpty(path)) {
|
|
88
|
+
success = false;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
bundlePaths.Add(path);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (!success) return;
|
|
96
|
+
|
|
97
|
+
// ******************** //
|
|
98
|
+
|
|
99
|
+
int bytesCount = 0;
|
|
100
|
+
for (int i = 0; i < platforms.Count; i++) {
|
|
101
|
+
var platform = platforms[i];
|
|
102
|
+
var buildOutputFile = bundlePaths[i];
|
|
103
|
+
|
|
104
|
+
// Update air asset
|
|
105
|
+
var bytes = await File.ReadAllBytesAsync(buildOutputFile);
|
|
106
|
+
Debug.Log("bytes length: " + bytes.Length + ", path: " + buildOutputFile);
|
|
107
|
+
bytesCount = bytes.Length;
|
|
108
|
+
var updateReq = UnityWebRequest.Put(AirshipPlatformUrl.deploymentService + $"/air-assets/{airId}",
|
|
109
|
+
JsonUtility.ToJson(new AirAssetCreateRequest() {
|
|
110
|
+
contentType = "application/airasset",
|
|
111
|
+
contentLength = bytes.Length,
|
|
112
|
+
name = contentName,
|
|
113
|
+
description = contentDescription,
|
|
114
|
+
platforms = platforms.Select((p) => AirshipPlatformUtil.GetStringName(p)).ToArray(),
|
|
115
|
+
}));
|
|
116
|
+
updateReq.SetRequestHeader("Content-Type", "application/json");
|
|
117
|
+
updateReq.SetRequestHeader("Authorization", "Bearer " + InternalHttpManager.editorAuthToken);
|
|
118
|
+
updateReq.SetRequestHeader("x-airship-ignore-rate-limit", "true");
|
|
119
|
+
await updateReq.SendWebRequest();
|
|
120
|
+
if (updateReq.result != UnityWebRequest.Result.Success) {
|
|
121
|
+
Debug.LogError("Failed to update air asset: " + updateReq.downloadHandler.text);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
var updateData = JsonUtility.FromJson<AirAssetCreateResponse>(updateReq.downloadHandler.text);
|
|
125
|
+
var uploadUrl = updateData.urls.UrlFromPlatform(platform);
|
|
126
|
+
|
|
127
|
+
// Upload asset bundle
|
|
128
|
+
{
|
|
129
|
+
UnityWebRequest putReq = UnityWebRequest.Put(uploadUrl, bytes);
|
|
130
|
+
foreach (var pair in updateData.headers) {
|
|
131
|
+
putReq.SetRequestHeader(pair.key, pair.value);
|
|
132
|
+
}
|
|
133
|
+
putReq.SetRequestHeader("x-airship-ignore-rate-limit", "true");
|
|
134
|
+
|
|
135
|
+
Debug.Log("Uploading asset bundle...");
|
|
136
|
+
await putReq.SendWebRequest();
|
|
137
|
+
if (putReq.result != UnityWebRequest.Result.Success) {
|
|
138
|
+
Debug.LogError(putReq.error);
|
|
139
|
+
Debug.LogError(putReq.downloadHandler.text);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
Debug.Log($"<color=green>Finished building {bundlePaths.Count} asset bundles for all platforms in {st.Elapsed.Seconds} seconds.</color> File size: " + AirshipEditorUtil.GetFileSizeText(bytesCount));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/// <summary>
|
|
149
|
+
///
|
|
150
|
+
/// </summary>
|
|
151
|
+
/// <param name="platform"></param>
|
|
152
|
+
/// <returns>Path to built bundle. Empty string if it failed.</returns>
|
|
153
|
+
private async Task<string> BuildPlatform(AirshipPlatform platform, string airId) {
|
|
154
|
+
var st = Stopwatch.StartNew();
|
|
155
|
+
var airAssetBundle = (AirAssetBundle)this.target;
|
|
156
|
+
|
|
157
|
+
var buildOutputFolder = "bundles/airassetbundle/";
|
|
158
|
+
var buildOutputFile = $"bundles/airassetbundle/{airId}_{AirshipPlatformUtil.GetStringName(platform)}.bundle";
|
|
159
|
+
var sourceFolderPath = Path.GetRelativePath(".", Directory.GetParent(AssetDatabase.GetAssetPath(airAssetBundle))!.FullName);
|
|
160
|
+
|
|
161
|
+
List<AssetBundleBuild> builds = CreateAssetBundles.GetPackageAssetBundleBuilds();
|
|
162
|
+
|
|
163
|
+
var assetGuids = AssetDatabase.FindAssets("*", new string[] {sourceFolderPath}).ToList();
|
|
164
|
+
var assetPaths = assetGuids
|
|
165
|
+
.Select((guid) => AssetDatabase.GUIDToAssetPath(guid))
|
|
166
|
+
.Where((path) => !path.ToLower().Contains("editor/"))
|
|
167
|
+
.Where((path) => !path.ToLower().Contains("exclude/"))
|
|
168
|
+
.Where((p) => !AssetDatabase.IsValidFolder(p))
|
|
169
|
+
.ToArray();
|
|
170
|
+
Debug.Log("Resources:");
|
|
171
|
+
foreach (var path in assetPaths) {
|
|
172
|
+
Debug.Log(" - " + path);
|
|
173
|
+
}
|
|
174
|
+
var addressableNames = assetPaths
|
|
175
|
+
.Select((p) => p.ToLower())
|
|
176
|
+
.Select((p) => {
|
|
177
|
+
if (p.Contains(target.name.ToLower() + ".asset")) {
|
|
178
|
+
// custom name so it's easier to find when loading
|
|
179
|
+
return "_AirAssetBundle";
|
|
180
|
+
}
|
|
181
|
+
return p;
|
|
182
|
+
})
|
|
183
|
+
.ToArray();
|
|
184
|
+
builds.Add(new AssetBundleBuild() {
|
|
185
|
+
assetBundleName = airId + $"_{AirshipPlatformUtil.GetStringName(platform)}.bundle",
|
|
186
|
+
assetNames = assetPaths,
|
|
187
|
+
addressableNames = addressableNames
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
// --------------------- //
|
|
191
|
+
// Build
|
|
192
|
+
if (!this.skipBuild) {
|
|
193
|
+
var buildTarget = AirshipPlatformUtil.ToBuildTarget(platform);
|
|
194
|
+
var buildTargetGroup = BuildPipeline.GetBuildTargetGroup(buildTarget);
|
|
195
|
+
if (platform is AirshipPlatform.Windows or AirshipPlatform.Mac or AirshipPlatform.Linux) {
|
|
196
|
+
buildTargetGroup = BuildTargetGroup.Standalone;
|
|
197
|
+
}
|
|
198
|
+
EditorUserBuildSettings.SwitchActiveBuildTarget(buildTargetGroup, buildTarget);
|
|
199
|
+
var buildParams = new BundleBuildParameters(
|
|
200
|
+
buildTarget,
|
|
201
|
+
buildTargetGroup,
|
|
202
|
+
buildOutputFolder
|
|
203
|
+
);
|
|
204
|
+
buildParams.UseCache = true;
|
|
205
|
+
EditorUserBuildSettings.switchRomCompressionType = SwitchRomCompressionType.Lz4;
|
|
206
|
+
buildParams.BundleCompression = BuildCompression.LZ4;
|
|
207
|
+
var buildContent = new BundleBuildContent(builds);
|
|
208
|
+
|
|
209
|
+
AirshipPackagesWindow.buildingPackageId = "game";
|
|
210
|
+
CreateAssetBundles.buildingBundles = true;
|
|
211
|
+
AirshipScriptableBuildPipelineConfig.buildingGameBundles = true;
|
|
212
|
+
ReturnCode returnCode = ContentPipeline.BuildAssetBundles(buildParams, buildContent, out var result);
|
|
213
|
+
CreateAssetBundles.buildingBundles = false;
|
|
214
|
+
AirshipScriptableBuildPipelineConfig.buildingGameBundles = false;
|
|
215
|
+
if (returnCode != ReturnCode.Success) {
|
|
216
|
+
Debug.LogError("Failed to build asset bundles. ReturnCode=" + returnCode);
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
Debug.Log($"Finished building {platform} in {st.Elapsed.TotalSeconds} seconds.");
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return buildOutputFile;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -54,7 +54,7 @@ public class EditorIntegrationsConfig : ScriptableSingleton<EditorIntegrationsCo
|
|
|
54
54
|
|
|
55
55
|
[FormerlySerializedAs("automaticTypeScriptCompilation")]
|
|
56
56
|
[SerializeField] public bool typescriptAutostartCompiler = true;
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
/// <summary>
|
|
59
59
|
/// The version of the compiler to use
|
|
60
60
|
/// </summary>
|
package/Editor/Publish/Deploy.cs
CHANGED
|
@@ -124,12 +124,23 @@ public class Deploy {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
// Rebuild Typescript
|
|
127
|
-
var
|
|
128
|
-
var
|
|
129
|
-
|
|
127
|
+
var skipRecompileOnCodeDeploy = skipBuild && TypescriptServicesLocalConfig.instance.skipCompileOnCodeDeploy;
|
|
128
|
+
var shouldRecompile = !skipBuild || !skipRecompileOnCodeDeploy;
|
|
129
|
+
var shouldResumeTypescriptWatch = shouldRecompile && TypescriptCompilationService.IsWatchModeRunning;
|
|
130
|
+
|
|
130
131
|
// We want to do a full publish
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
|
|
133
|
+
if (shouldRecompile) {
|
|
134
|
+
TypescriptCompilationService.StopCompilers();
|
|
135
|
+
|
|
136
|
+
var compileFlags = TypeScriptCompileFlags.Publishing | TypeScriptCompileFlags.DisplayProgressBar; // FullClean will clear the incremental file & Publishing will omit editor data
|
|
137
|
+
|
|
138
|
+
if (skipBuild) {
|
|
139
|
+
compileFlags |= TypeScriptCompileFlags.SkipReimportQueue; // code publish does not require asset reimport
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
TypescriptCompilationService.BuildTypescript(compileFlags);
|
|
143
|
+
}
|
|
133
144
|
|
|
134
145
|
if (TypescriptCompilationService.ErrorCount > 0) {
|
|
135
146
|
Debug.LogError($"Could not publish the project with {TypescriptCompilationService.ErrorCount} compilation error{(TypescriptCompilationService.ErrorCount == 1 ? "" : "s")}");
|