mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
[unity] Fixed SpineBuildPreprocessor pre-build order on Unity 2021.2 and newer (using BuildPlayerProcessor). See #1890.
This commit is contained in:
parent
922ac2bec9
commit
030b2854f5
@ -31,6 +31,10 @@
|
|||||||
#define HAS_BUILD_PROCESS_WITH_REPORT
|
#define HAS_BUILD_PROCESS_WITH_REPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if UNITY_2021_2_OR_NEWER
|
||||||
|
#define HAS_BUILD_PLAYER_PROCESSOR
|
||||||
|
#endif
|
||||||
|
|
||||||
#if UNITY_2020_2_OR_NEWER
|
#if UNITY_2020_2_OR_NEWER
|
||||||
#define HAS_ON_POSTPROCESS_PREFAB
|
#define HAS_ON_POSTPROCESS_PREFAB
|
||||||
#endif
|
#endif
|
||||||
@ -258,26 +262,43 @@ namespace Spine.Unity.Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SpineBuildPreprocessor :
|
#if HAS_BUILD_PLAYER_PROCESSOR
|
||||||
#if HAS_BUILD_PROCESS_WITH_REPORT
|
/// <summary>
|
||||||
IPreprocessBuildWithReport
|
/// Build Preprocessor for Unity 2021.2 and newer.
|
||||||
#else
|
/// Unfortunately BuildPlayerProcessors seem to be executed before IPreprocessBuildWithReport regardless of
|
||||||
IPreprocessBuild
|
/// callbackOrder, thus requiring use of this base class to call pre-build hooks before Addressables or
|
||||||
#endif
|
/// Asset Bundles are built.
|
||||||
{
|
/// </summary>
|
||||||
|
public class SpineBuildPreprocessor : UnityEditor.Build.BuildPlayerProcessor {
|
||||||
|
public override int callbackOrder {
|
||||||
|
get { return -2000; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void PrepareForBuild (BuildPlayerContext buildPlayerContext) {
|
||||||
|
SpineBuildProcessor.PreprocessBuild();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#elif HAS_BUILD_PROCESS_WITH_REPORT
|
||||||
|
public class SpineBuildPreprocessor : IPreprocessBuildWithReport {
|
||||||
public int callbackOrder {
|
public int callbackOrder {
|
||||||
get { return -2000; }
|
get { return -2000; }
|
||||||
}
|
}
|
||||||
#if HAS_BUILD_PROCESS_WITH_REPORT
|
|
||||||
void IPreprocessBuildWithReport.OnPreprocessBuild (BuildReport report) {
|
void IPreprocessBuildWithReport.OnPreprocessBuild (BuildReport report) {
|
||||||
SpineBuildProcessor.PreprocessBuild();
|
SpineBuildProcessor.PreprocessBuild();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
|
public class SpineBuildPreprocessor : IPreprocessBuild {
|
||||||
|
public int callbackOrder {
|
||||||
|
get { return -2000; }
|
||||||
|
}
|
||||||
|
|
||||||
void IPreprocessBuild.OnPreprocessBuild (BuildTarget target, string path) {
|
void IPreprocessBuild.OnPreprocessBuild (BuildTarget target, string path) {
|
||||||
SpineBuildProcessor.PreprocessBuild();
|
SpineBuildProcessor.PreprocessBuild();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
public class SpineBuildPostprocessor :
|
public class SpineBuildPostprocessor :
|
||||||
#if HAS_BUILD_PROCESS_WITH_REPORT
|
#if HAS_BUILD_PROCESS_WITH_REPORT
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.spine-unity",
|
"name": "com.esotericsoftware.spine.spine-unity",
|
||||||
"displayName": "spine-unity Runtime",
|
"displayName": "spine-unity Runtime",
|
||||||
"description": "This plugin provides the spine-unity runtime core.",
|
"description": "This plugin provides the spine-unity runtime core.",
|
||||||
"version": "4.2.44",
|
"version": "4.2.45",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user