ParticleSystemCurveEditor.GetAvailableColor C# (CSharp) Method

GetAvailableColor() public method

public GetAvailableColor ( ) : Color
return Color
    public Color GetAvailableColor()
    {
        if (this.m_AvailableColors.Count == 0)
        {
            this.m_AvailableColors = new List<Color>(this.m_Colors);
        }
        int index = this.m_AvailableColors.Count - 1;
        Color color = this.m_AvailableColors[index];
        this.m_AvailableColors.RemoveAt(index);
        return color;
    }

Usage Example

        public void SetMinMaxState(MinMaxCurveState newState, bool addToCurveEditor = true)
        {
            if (!this.stateHasMultipleDifferentValues)
            {
                if (newState == this.state)
                {
                    return;
                }
            }
            MinMaxCurveState          state = this.state;
            ParticleSystemCurveEditor particleSystemCurveEditor = this.m_Module.GetParticleSystemCurveEditor();

            if (particleSystemCurveEditor.IsAdded(this.GetMinCurve(), this.maxCurve))
            {
                particleSystemCurveEditor.RemoveCurve(this.GetMinCurve(), this.maxCurve);
            }
            switch (newState)
            {
            case MinMaxCurveState.k_Scalar:
                this.InitSingleScalar(state);
                break;

            case MinMaxCurveState.k_Curve:
                this.InitSingleCurve(state);
                break;

            case MinMaxCurveState.k_TwoCurves:
                this.InitDoubleCurves(state);
                break;

            case MinMaxCurveState.k_TwoScalars:
                this.InitDoubleScalars(state);
                break;
            }
            this.minMaxState.intValue = (int)newState;
            if (addToCurveEditor)
            {
                switch (newState)
                {
                case MinMaxCurveState.k_Scalar:
                case MinMaxCurveState.k_TwoScalars:
                    break;

                case MinMaxCurveState.k_Curve:
                case MinMaxCurveState.k_TwoCurves:
                    particleSystemCurveEditor.AddCurve(this.CreateCurveData(particleSystemCurveEditor.GetAvailableColor()));
                    break;

                default:
                    Debug.LogError("Unhandled enum value");
                    break;
                }
            }
            AnimationCurvePreviewCache.ClearCache();
        }
All Usage Examples Of ParticleSystemCurveEditor::GetAvailableColor