Merge branch '4.1' into 4.2-beta

This commit is contained in:
Harald Csaszar 2022-09-09 15:41:16 +02:00
commit 9a2bb82ce8
4 changed files with 18 additions and 2 deletions

View File

@ -88,6 +88,7 @@
* Timeline `SkeletonAnimation Track` and `SkeletonGraphic Track` now provide an `Unscaled Time` property. Whenever starting a new animation clip of this track, `SkeletonAnimation.UnscaledTime` or `SkeletonGraphic.UnscaledTime` will be set to this value. This allows you to play back Timeline clips either in normal game time or unscaled game time. Note that `PlayableDirector.UpdateMethod` is ignored and replaced by this property, which allows more fine-granular control per Timeline track.
* Added `SkeletonRootMotion` callback delegates `ProcessRootMotionOverride` and `PhysicsUpdateRootMotionOverride` to customize how root motion is applied. The new property `disableOnOverride` determines whether the callback will be issued in addition or instead of normally applying root motion. Added property `rootMotionScaleRotation` to allow scaling rotational root-motion to match e.g. a 90 degree rotation to a custom target angle.
* Added outline shader parameter `Advanced - Opaque Alpha` which can be used to exclude problematic semi-transparent areas, which may receive an undesired large outline color overlay otherwise.
* Added Spine Preferences setting `Prefabs` - `Optimize Preview Meshes`. When enabled, Spine prefab preview meshes will be removed in a pre-build step to reduce build size. This increases build time as all prefabs in the project will be processed. Defaults to false to not slow down builds substantially every time.
* **Breaking changes**
* Made `SkeletonGraphic.unscaledTime` parameter protected, use the new property `UnscaledTime` instead.

View File

@ -67,7 +67,8 @@ namespace Spine.Unity.Editor {
internal static void PreprocessBuild () {
isBuilding = true;
#if HAS_ON_POSTPROCESS_PREFAB
PreprocessSpinePrefabMeshes();
if (SpineEditorUtilities.Preferences.removePrefabPreviewMeshes)
PreprocessSpinePrefabMeshes();
#endif
PreprocessSpriteAtlases();
}
@ -75,7 +76,8 @@ namespace Spine.Unity.Editor {
internal static void PostprocessBuild () {
isBuilding = false;
#if HAS_ON_POSTPROCESS_PREFAB
PostprocessSpinePrefabMeshes();
if (SpineEditorUtilities.Preferences.removePrefabPreviewMeshes)
PostprocessSpinePrefabMeshes();
#endif
PostprocessSpriteAtlases();
}

View File

@ -89,6 +89,9 @@ namespace Spine.Unity.Editor {
#if HAS_ON_POSTPROCESS_PREFAB
internal const bool DEFAULT_FIX_PREFAB_OVERRIDE_VIA_MESH_FILTER = false;
public bool fixPrefabOverrideViaMeshFilter = DEFAULT_FIX_PREFAB_OVERRIDE_VIA_MESH_FILTER;
internal const bool DEFAULT_REMOVE_PREFAB_PREVIEW_MESHES = false;
public bool removePrefabPreviewMeshes = DEFAULT_REMOVE_PREFAB_PREVIEW_MESHES;
#endif
public bool UsesPMAWorkflow {
@ -324,6 +327,8 @@ namespace Spine.Unity.Editor {
{
EditorGUILayout.PropertyField(settings.FindProperty("fixPrefabOverrideViaMeshFilter"), new GUIContent("Fix Prefab Overr. MeshFilter", "Fixes the prefab always being marked as changed (sets the MeshFilter's hide flags to DontSaveInEditor), but at the cost of references to the MeshFilter by other components being lost. This is a global setting that can be overwritten on each SkeletonRenderer"));
SkeletonRenderer.fixPrefabOverrideViaMeshFilterGlobal = settings.FindProperty("fixPrefabOverrideViaMeshFilter").boolValue;
EditorGUILayout.PropertyField(settings.FindProperty("removePrefabPreviewMeshes"), new GUIContent("Optimize Preview Meshes", "When enabled, Spine prefab preview meshes will be removed in a pre-build step to reduce build size. This increases build time as all prefabs in the project will be processed."));
}
#endif

View File

@ -43,6 +43,10 @@
#define CONFIGURABLE_ENTER_PLAY_MODE
#endif
#if UNITY_2020_1_OR_NEWER
#define REVERT_HAS_OVERLOADS
#endif
#define SPINE_OPTIONAL_RENDEROVERRIDE
#define SPINE_OPTIONAL_MATERIALOVERRIDE
@ -100,7 +104,11 @@ namespace Spine.Unity {
var objectOverrides = UnityEditor.PrefabUtility.GetObjectOverrides(instanceRoot);
foreach (UnityEditor.SceneManagement.ObjectOverride objectOverride in objectOverrides) {
if (objectOverride.instanceObject == meshFilter) {
#if REVERT_HAS_OVERLOADS
objectOverride.Revert(UnityEditor.InteractionMode.AutomatedAction);
#else
objectOverride.Revert();
#endif
break;
}
}