fix: error on build in Unity 2019.3.11-15

Close #114
pull/120/head
mob-sakai 2020-11-10 01:42:28 +09:00
parent 1b1ca56461
commit 68669c7396
1 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,6 @@
#if UNITY_2019_3_11 || UNITY_2019_3_12 || UNITY_2019_3_13 || UNITY_2019_3_14 || UNITY_2019_3_15 || UNITY_2019_4_OR_NEWER
#define SERIALIZE_FIELD_MASKABLE
#endif
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Coffee.UIParticleExtensions; using Coffee.UIParticleExtensions;
@ -38,7 +41,7 @@ namespace Coffee.UIExtensions
[Tooltip("Particles")] [SerializeField] [Tooltip("Particles")] [SerializeField]
private List<ParticleSystem> m_Particles = new List<ParticleSystem>(); private List<ParticleSystem> m_Particles = new List<ParticleSystem>();
#if !UNITY_2019_4_OR_NEWER #if !SERIALIZE_FIELD_MASKABLE
[SerializeField] [SerializeField]
private bool m_Maskable = true; private bool m_Maskable = true;
#endif #endif
@ -355,7 +358,7 @@ namespace Coffee.UIExtensions
/// </summary> /// </summary>
protected override void OnEnable() protected override void OnEnable()
{ {
#if !UNITY_2019_4_OR_NEWER #if !SERIALIZE_FIELD_MASKABLE
maskable = m_Maskable; maskable = m_Maskable;
#endif #endif
_cachedPosition = transform.localPosition; _cachedPosition = transform.localPosition;
@ -448,7 +451,7 @@ namespace Coffee.UIExtensions
SetVerticesDirty(); SetVerticesDirty();
m_ShouldRecalculateStencil = true; m_ShouldRecalculateStencil = true;
RecalculateClipping(); RecalculateClipping();
#if !UNITY_2019_4_OR_NEWER #if !SERIALIZE_FIELD_MASKABLE
maskable = m_Maskable; maskable = m_Maskable;
#endif #endif
} }