Ejemplo n.º 1
0
        /// <summary>Enforce bounds for fields, when changed in inspector.</summary>
        protected override void OnValidate()
        {
            base.OnValidate();

            // Upgrade after a legacy deserialize
            if (m_LegacyHeadingBias != float.MaxValue)
            {
                m_Heading.m_Bias    = m_LegacyHeadingBias;
                m_LegacyHeadingBias = float.MaxValue;
                int heading = (int)m_Heading.m_Definition;
                if (m_RecenterToTargetHeading.LegacyUpgrade(ref heading, ref m_Heading.m_VelocityFilterStrength))
                {
                    m_Heading.m_Definition = (CinemachineOrbitalTransposer.Heading.HeadingDefinition)heading;
                }
                mUseLegacyRigDefinitions = true;
            }
            if (m_LegacyBlendHint != BlendHint.None)
            {
                m_Transitions.m_BlendHint = m_LegacyBlendHint;
                m_LegacyBlendHint         = BlendHint.None;
            }
            m_YAxis.Validate();
            m_XAxis.Validate();
            m_RecenterToTargetHeading.Validate();
            m_YAxisRecentering.Validate();
            m_Lens.Validate();

            InvalidateRigCache();
        }
 /// <summary>Enforce bounds for fields, when changed in inspector.</summary>
 protected override void OnValidate()
 {
     base.OnValidate();
     m_Lens.Validate();
     if (m_LegacyBlendHint != BlendHint.None)
     {
         m_Transitions.m_BlendHint = m_LegacyBlendHint;
         m_LegacyBlendHint         = BlendHint.None;
     }
 }
Ejemplo n.º 3
0
        /// <summary>Enforce bounds for fields, when changed in inspector.</summary>
        protected override void OnValidate()
        {
            base.OnValidate();

            // Upgrade after a legacy deserialize
            if (m_LegacyHeadingBias != float.MaxValue)
            {
                m_Heading.m_HeadingBias = m_LegacyHeadingBias;
                m_LegacyHeadingBias     = float.MaxValue;
                m_RecenterToTargetHeading.LegacyUpgrade(
                    ref m_Heading.m_HeadingDefinition, ref m_Heading.m_VelocityFilterStrength);
                mUseLegacyRigDefinitions = true;
            }
            m_YAxis.Validate();
            m_XAxis.Validate();
            m_RecenterToTargetHeading.Validate();
            m_Lens.Validate();

            InvalidateRigCache();
        }
Ejemplo n.º 4
0
        /// <summary>Enforce bounds for fields, when changed in inspector.</summary>
        protected override void OnValidate()
        {
            base.OnValidate();

            // Upgrade after a legacy deserialize
            if (m_LegacyHeadingBias != float.MaxValue)
            {
                m_Heading.m_Bias    = m_LegacyHeadingBias;
                m_LegacyHeadingBias = float.MaxValue;
                int heading = (int)m_Heading.m_Definition;
                if (m_RecenterToTargetHeading.LegacyUpgrade(ref heading, ref m_Heading.m_VelocityFilterStrength))
                {
                    m_Heading.m_Definition = (CinemachineOrbitalTransposer.Heading.HeadingDefinition)heading;
                }
                mUseLegacyRigDefinitions = true;
            }
            if (m_LegacyBlendHint != BlendHint.None)
            {
                m_Transitions.m_BlendHint = m_LegacyBlendHint;
                m_LegacyBlendHint         = BlendHint.None;
            }
            m_YAxis.Validate();
            m_XAxis.Validate();
            m_RecenterToTargetHeading.Validate();
            m_YAxisRecentering.Validate();
            m_Lens.Validate();

            InvalidateRigCache();

#if UNITY_EDITOR
            for (int i = 0; m_Rigs != null && i < 3 && i < m_Rigs.Length; ++i)
            {
                if (m_Rigs[i] != null)
                {
                    CinemachineVirtualCamera.SetFlagsForHiddenChild(m_Rigs[i].gameObject);
                }
            }
#endif
        }
Ejemplo n.º 5
0
 /// <summary>Enforce bounds for fields, when changed in inspector.</summary>
 protected override void OnValidate()
 {
     base.OnValidate();
     m_Lens.Validate();
 }