mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] for 3.7 branch only: added a non-behaviour changing implementation of SettingsProvider for Unity 2018.3+. In case of merge conflicts to 3.8-beta branch discard this commit's changes, 3.8 already contains a full-fledged SettingsProvider implementation. Closes #1405
This commit is contained in:
parent
5b0d446b1f
commit
8532d3a929
@ -46,6 +46,10 @@
|
||||
#define NEWHIERARCHYWINDOWCALLBACKS
|
||||
#endif
|
||||
|
||||
#if UNITY_2018_3_OR_NEWER
|
||||
#define NEW_PREFERENCES_SETTINGS_PROVIDER
|
||||
#endif
|
||||
|
||||
#if UNITY_2019_1_OR_NEWER
|
||||
#define NEW_TIMELINE_AS_PACKAGE
|
||||
#endif
|
||||
@ -174,11 +178,33 @@ namespace Spine.Unity.Editor {
|
||||
|
||||
static int STRAIGHT_ALPHA_PARAM_ID = Shader.PropertyToID("_StraightAlphaInput");
|
||||
|
||||
#if NEW_PREFERENCES_SETTINGS_PROVIDER
|
||||
static class SpineSettingsProviderRegistration
|
||||
{
|
||||
[SettingsProvider]
|
||||
public static SettingsProvider CreateSpineSettingsProvider()
|
||||
{
|
||||
var provider = new SettingsProvider("Spine", SettingsScope.User)
|
||||
{
|
||||
label = "Spine",
|
||||
guiHandler = (searchContext) =>
|
||||
{
|
||||
Preferences.HandlePreferencesGUI(); // This line shall NOT be merged to 3.8 branch. Version to provide a non-behavior-changing implementation for 3.7 branch.
|
||||
},
|
||||
|
||||
// Populate the search keywords to enable smart search filtering and label highlighting:
|
||||
keywords = new HashSet<string>(new[] { "Spine", "Preferences", "Skeleton", "Default", "Mix", "Duration" })
|
||||
};
|
||||
return provider;
|
||||
}
|
||||
}
|
||||
#else
|
||||
// Preferences entry point
|
||||
[PreferenceItem("Spine")]
|
||||
static void PreferencesGUI () {
|
||||
Preferences.HandlePreferencesGUI();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Auto-import entry point
|
||||
static void OnPostprocessAllAssets (string[] imported, string[] deleted, string[] moved, string[] movedFromAssetPaths) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user