private void Add(ParticleSystemCurveEditor.CurveData cd)
 {
     this.m_CurveEditor.SelectNone();
     this.m_AddedCurves.Add(cd);
     this.ContentChanged();
     SessionState.SetVector3(cd.m_UniqueName, new Vector3(cd.m_Color.r, cd.m_Color.g, cd.m_Color.b));
     this.UpdateRangeBasedOnShownCurves();
 }
Exemple #2
0
    private void RemoveTopMost()
    {
        int num;

        if (this.m_CurveEditor.GetTopMostCurveID(out num))
        {
            for (int i = 0; i < this.m_AddedCurves.Count; i++)
            {
                ParticleSystemCurveEditor.CurveData curveData = this.m_AddedCurves[i];
                if (curveData.m_MaxId == num || curveData.m_MinId == num)
                {
                    this.Remove(i);
                    this.ContentChanged();
                    this.UpdateRangeBasedOnShownCurves();
                    break;
                }
            }
        }
    }
Exemple #3
0
    public void AddCurveDataIfNeeded(string curveName, ParticleSystemCurveEditor.CurveData curveData)
    {
        Vector3 vector = SessionState.GetVector3(curveName, Vector3.zero);

        if (vector != Vector3.zero)
        {
            Color color = new Color(vector.x, vector.y, vector.z);
            curveData.m_Color = color;
            this.AddCurve(curveData);
            for (int i = 0; i < this.m_AvailableColors.Count; i++)
            {
                if (ParticleSystemCurveEditor.SameColor(this.m_AvailableColors[i], color))
                {
                    this.m_AvailableColors.RemoveAt(i);
                    break;
                }
            }
        }
    }
Exemple #4
0
    private void RemoveTopMost()
    {
        int curveID;

        if (!this.m_CurveEditor.GetTopMostCurveID(out curveID))
        {
            return;
        }
        for (int index = 0; index < this.m_AddedCurves.Count; ++index)
        {
            ParticleSystemCurveEditor.CurveData addedCurve = this.m_AddedCurves[index];
            if (addedCurve.m_MaxId == curveID || addedCurve.m_MinId == curveID)
            {
                this.Remove(index);
                this.ContentChanged();
                this.UpdateRangeBasedOnShownCurves();
                break;
            }
        }
    }
Exemple #5
0
    public void AddCurveDataIfNeeded(string curveName, ParticleSystemCurveEditor.CurveData curveData)
    {
        Vector3 vector3 = SessionState.GetVector3(curveName, Vector3.zero);

        if (!(vector3 != Vector3.zero))
        {
            return;
        }
        Color c2 = new Color(vector3.x, vector3.y, vector3.z);

        curveData.m_Color = c2;
        this.AddCurve(curveData);
        for (int index = 0; index < this.m_AvailableColors.Count; ++index)
        {
            if (ParticleSystemCurveEditor.SameColor(this.m_AvailableColors[index], c2))
            {
                this.m_AvailableColors.RemoveAt(index);
                break;
            }
        }
    }
Exemple #6
0
    private CurveWrapper[] CreateCurveWrapperArray()
    {
        List <CurveWrapper> list = new List <CurveWrapper>();
        int num = 0;
        int i   = 0;

        while (i < this.m_AddedCurves.Count)
        {
            ParticleSystemCurveEditor.CurveData curveData = this.m_AddedCurves[i];
            if (curveData.m_Visible)
            {
                if (curveData.m_Max == null || !curveData.m_Max.hasMultipleDifferentValues)
                {
                    if (curveData.m_Min == null || !curveData.m_Min.hasMultipleDifferentValues)
                    {
                        int regionId = -1;
                        if (curveData.IsRegion())
                        {
                            num = (regionId = num + 1);
                        }
                        if (curveData.m_Max != null)
                        {
                            list.Add(this.CreateCurveWrapper(curveData.m_Max, curveData.m_MaxId, regionId, curveData.m_Color, curveData.m_SignedRange, curveData.m_GetAxisScalarsCallback, curveData.m_SetAxisScalarsCallback));
                        }
                        if (curveData.m_Min != null)
                        {
                            list.Add(this.CreateCurveWrapper(curveData.m_Min, curveData.m_MinId, regionId, curveData.m_Color, curveData.m_SignedRange, curveData.m_GetAxisScalarsCallback, curveData.m_SetAxisScalarsCallback));
                        }
                    }
                }
            }
IL_FF:
            i++;
            continue;
            goto IL_FF;
        }
        return(list.ToArray());
    }
Exemple #7
0
 public void AddCurve(ParticleSystemCurveEditor.CurveData curveData)
 {
     this.Add(curveData);
 }