GetAvailableColor() public method

public GetAvailableColor ( ) : Color
return Color
        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();
        }
        public void ToggleCurveInEditor()
        {
            ParticleSystemCurveEditor particleSystemCurveEditor = this.m_Module.GetParticleSystemCurveEditor();

            if (particleSystemCurveEditor.IsAdded(this.GetMinCurve(), this.maxCurve))
            {
                particleSystemCurveEditor.RemoveCurve(this.GetMinCurve(), this.maxCurve);
            }
            else
            {
                particleSystemCurveEditor.AddCurve(this.CreateCurveData(particleSystemCurveEditor.GetAvailableColor()));
            }
        }
Esempio n. 3
0
        public void ToggleCurveInEditor()
        {
            ParticleSystemCurveEditor sce = m_Module.GetParticleSystemCurveEditor();

            if (sce.IsAdded(GetMinCurve(), maxCurve))
            {
                sce.RemoveCurve(GetMinCurve(), maxCurve);
            }
            else
            {
                sce.AddCurve(CreateCurveData(sce.GetAvailableColor()));
            }
        }
Esempio n. 4
0
        public void SetMinMaxState(MinMaxCurveState newState, bool addToCurveEditor)
        {
            if (newState == state)
            {
                return;
            }

            MinMaxCurveState          oldState = state;
            ParticleSystemCurveEditor sce      = m_Module.GetParticleSystemCurveEditor();

            if (sce.IsAdded(GetMinCurve(), maxCurve))
            {
                sce.RemoveCurve(GetMinCurve(), maxCurve);
            }

            switch (newState)
            {
            case MinMaxCurveState.k_Curve: SetCurveRequirements(); break;

            case MinMaxCurveState.k_TwoCurves: SetCurveRequirements(); break;
            }

            // Assign state AFTER matching data to new state AND removing curve from curveEditor since it uses current 'state'
            minMaxState.intValue = (int)newState;

            if (addToCurveEditor)
            {
                // Add curve to CurveEditor if needed
                // Keep added to the editor if it was added before
                switch (newState)
                {
                case MinMaxCurveState.k_TwoCurves:
                case MinMaxCurveState.k_Curve:
                    sce.AddCurve(CreateCurveData(sce.GetAvailableColor()));
                    break;

                case MinMaxCurveState.k_Scalar:
                case MinMaxCurveState.k_TwoScalars:
                    // Scalar do not add anything to the curve editor
                    break;

                default:
                    Debug.LogError("Unhandled enum value");
                    break;
                }
            }

            // Ensure we draw new icons for properties
            UnityEditorInternal.AnimationCurvePreviewCache.ClearCache();
        }
        private void SetMinMaxState(MinMaxCurveState newState)
        {
            if (newState == this.state)
            {
                return;
            }
            MinMaxCurveState          state             = this.state;
            ParticleSystemCurveEditor systemCurveEditor = this.m_Module.GetParticleSystemCurveEditor();

            if (systemCurveEditor.IsAdded(this.GetMinCurve(), this.maxCurve))
            {
                systemCurveEditor.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;
            switch (newState)
            {
            case MinMaxCurveState.k_Scalar:
            case MinMaxCurveState.k_TwoScalars:
                AnimationCurvePreviewCache.ClearCache();
                break;

            case MinMaxCurveState.k_Curve:
            case MinMaxCurveState.k_TwoCurves:
                systemCurveEditor.AddCurve(this.CreateCurveData(systemCurveEditor.GetAvailableColor()));
                goto case MinMaxCurveState.k_Scalar;

            default:
                Debug.LogError((object)"Unhandled enum value");
                goto case MinMaxCurveState.k_Scalar;
            }
        }
        public void SetMinMaxState(MinMaxCurveState newState, bool addToCurveEditor)
        {
            if (this.stateHasMultipleDifferentValues)
            {
                Debug.LogError("SetMinMaxState is not allowed with multiple different values");
            }
            else if (newState != this.state)
            {
                MinMaxCurveState          state = this.state;
                ParticleSystemCurveEditor particleSystemCurveEditor = this.m_Module.GetParticleSystemCurveEditor();
                if (particleSystemCurveEditor.IsAdded(this.GetMinCurve(), this.maxCurve))
                {
                    particleSystemCurveEditor.RemoveCurve(this.GetMinCurve(), this.maxCurve);
                }
                if (newState != MinMaxCurveState.k_Curve)
                {
                    if (newState == MinMaxCurveState.k_TwoCurves)
                    {
                        this.SetCurveRequirements();
                    }
                }
                else
                {
                    this.SetCurveRequirements();
                }
                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();
            }
        }