AddToModuleCurves() public method

public AddToModuleCurves ( UnityEditor.SerializedProperty curveProp ) : void
curveProp UnityEditor.SerializedProperty
return void
 private void Init(ModuleUI m, GUIContent displayName, string uniqueName, bool signedRange, bool useProp0)
 {
     this.m_Module              = m;
     this.m_DisplayName         = displayName;
     this.m_Name                = uniqueName;
     this.m_SignedRange         = signedRange;
     this.m_RemapValue          = 1f;
     this.m_DefaultCurveScalar  = 1f;
     this.m_AllowConstant       = true;
     this.m_AllowRandom         = true;
     this.m_AllowCurves         = true;
     this.scalar                = ((!useProp0) ? m.GetProperty(this.m_Name, "scalar") : m.GetProperty0(this.m_Name, "scalar"));
     this.maxCurve              = ((!useProp0) ? m.GetProperty(this.m_Name, "maxCurve") : m.GetProperty0(this.m_Name, "maxCurve"));
     this.maxCurveFirstKeyValue = this.maxCurve.FindPropertyRelative("m_Curve.Array.data[0].value");
     this.minCurve              = ((!useProp0) ? m.GetProperty(this.m_Name, "minCurve") : m.GetProperty0(this.m_Name, "minCurve"));
     this.minCurveFirstKeyValue = this.minCurve.FindPropertyRelative("m_Curve.Array.data[0].value");
     this.minMaxState           = ((!useProp0) ? m.GetProperty(this.m_Name, "minMaxState") : m.GetProperty0(this.m_Name, "minMaxState"));
     if (this.state == MinMaxCurveState.k_Curve || this.state == MinMaxCurveState.k_TwoCurves)
     {
         if (this.m_Module.m_ParticleSystemUI.m_ParticleEffectUI.IsParticleSystemUIVisible(this.m_Module.m_ParticleSystemUI))
         {
             m.GetParticleSystemCurveEditor().AddCurveDataIfNeeded(this.GetUniqueCurveName(), this.CreateCurveData(Color.black));
         }
     }
     m.AddToModuleCurves(this.maxCurve);
 }
Beispiel #2
0
        void Init(ModuleUI m, GUIContent displayName, string uniqueName, bool signedRange, bool useProp0, bool addCurveIfNeeded)
        {
            m_Module             = m;
            m_DisplayName        = displayName;
            m_Name               = uniqueName;
            m_SignedRange        = signedRange;
            m_RemapValue         = 1.0f;
            m_DefaultCurveScalar = 1.0f;
            m_AllowConstant      = true;
            m_AllowRandom        = true;
            m_AllowCurves        = true;

            rootProperty = useProp0 ? m.GetProperty0(m_Name) : m.GetProperty(m_Name);
            scalar       = useProp0 ? m.GetProperty0(m_Name, "scalar") : m.GetProperty(m_Name, "scalar");
            minScalar    = useProp0 ? m.GetProperty0(m_Name, "minScalar") : m.GetProperty(m_Name, "minScalar");
            maxCurve     = useProp0 ? m.GetProperty0(m_Name, "maxCurve") : m.GetProperty(m_Name, "maxCurve");
            minCurve     = useProp0 ? m.GetProperty0(m_Name, "minCurve") : m.GetProperty(m_Name, "minCurve");
            minMaxState  = useProp0 ? m.GetProperty0(m_Name, "minMaxState") : m.GetProperty(m_Name, "minMaxState");

            // Reconstruct added curves when we initialize
            if (addCurveIfNeeded)
            {
                if (state == MinMaxCurveState.k_Curve || state == MinMaxCurveState.k_TwoCurves)
                {
                    if (m_Module.m_ParticleSystemUI.m_ParticleEffectUI.IsParticleSystemUIVisible(m_Module.m_ParticleSystemUI))
                    {
                        m.GetParticleSystemCurveEditor().AddCurveDataIfNeeded(GetUniqueCurveName(), CreateCurveData(Color.black));
                    }
                }
            }
            m.AddToModuleCurves(maxCurve); // It is enough just to add max
        }
 private void Init(ModuleUI m, GUIContent displayName, string uniqueName, bool signedRange, bool useProp0)
 {
     this.m_Module = m;
     this.m_DisplayName = displayName;
     this.m_Name = uniqueName;
     this.m_SignedRange = signedRange;
     this.m_RemapValue = 1f;
     this.m_DefaultCurveScalar = 1f;
     this.m_AllowConstant = true;
     this.m_AllowRandom = true;
     this.m_AllowCurves = true;
     this.scalar = !useProp0 ? m.GetProperty(this.m_Name, "scalar") : m.GetProperty0(this.m_Name, "scalar");
     this.maxCurve = !useProp0 ? m.GetProperty(this.m_Name, "maxCurve") : m.GetProperty0(this.m_Name, "maxCurve");
     this.maxCurveFirstKeyValue = this.maxCurve.FindPropertyRelative("m_Curve.Array.data[0].value");
     this.minCurve = !useProp0 ? m.GetProperty(this.m_Name, "minCurve") : m.GetProperty0(this.m_Name, "minCurve");
     this.minCurveFirstKeyValue = this.minCurve.FindPropertyRelative("m_Curve.Array.data[0].value");
     this.minMaxState = !useProp0 ? m.GetProperty(this.m_Name, "minMaxState") : m.GetProperty0(this.m_Name, "minMaxState");
     if (((this.state == MinMaxCurveState.k_Curve) || (this.state == MinMaxCurveState.k_TwoCurves)) && this.m_Module.m_ParticleSystemUI.m_ParticleEffectUI.IsParticleSystemUIVisible(this.m_Module.m_ParticleSystemUI))
     {
         m.GetParticleSystemCurveEditor().AddCurveDataIfNeeded(this.GetUniqueCurveName(), this.CreateCurveData(Color.black));
     }
     m.AddToModuleCurves(this.maxCurve);
 }