Example #1
0
 protected override void Init()
 {
     if (this.m_Ratio == null)
     {
         if (TrailModuleUI.s_Texts == null)
         {
             TrailModuleUI.s_Texts = new TrailModuleUI.Texts();
         }
         this.m_Mode                   = base.GetProperty("mode");
         this.m_Ratio                  = base.GetProperty("ratio");
         this.m_Lifetime               = new SerializedMinMaxCurve(this, TrailModuleUI.s_Texts.lifetime, "lifetime");
         this.m_MinVertexDistance      = base.GetProperty("minVertexDistance");
         this.m_TextureMode            = base.GetProperty("textureMode");
         this.m_WorldSpace             = base.GetProperty("worldSpace");
         this.m_DieWithParticles       = base.GetProperty("dieWithParticles");
         this.m_SizeAffectsWidth       = base.GetProperty("sizeAffectsWidth");
         this.m_SizeAffectsLifetime    = base.GetProperty("sizeAffectsLifetime");
         this.m_InheritParticleColor   = base.GetProperty("inheritParticleColor");
         this.m_ColorOverLifetime      = new SerializedMinMaxGradient(this, "colorOverLifetime");
         this.m_WidthOverTrail         = new SerializedMinMaxCurve(this, TrailModuleUI.s_Texts.widthOverTrail, "widthOverTrail");
         this.m_ColorOverTrail         = new SerializedMinMaxGradient(this, "colorOverTrail");
         this.m_GenerateLightingData   = base.GetProperty("generateLightingData");
         this.m_RibbonCount            = base.GetProperty("ribbonCount");
         this.m_SplitSubEmitterRibbons = base.GetProperty("splitSubEmitterRibbons");
     }
 }
Example #2
0
        public void GUIMinMaxGradient(GUIContent label, SerializedMinMaxGradient minMaxGradient)
        {
            MinMaxGradientState state = minMaxGradient.state;
            bool flag      = state >= MinMaxGradientState.k_RandomBetweenTwoColors;
            Rect position  = GUILayoutUtility.GetRect(0f, !flag ? ((float)13) : ((float)0x1a));
            Rect popupRect = GetPopupRect(position);
            Rect rect      = PrefixLabel(SubtractPopupWidth(position), label);

            rect.height = 13f;
            switch (state)
            {
            case MinMaxGradientState.k_Color:
                GUIColor(rect, minMaxGradient.m_MaxColor);
                break;

            case MinMaxGradientState.k_Gradient:
                EditorGUI.GradientField(rect, minMaxGradient.m_MaxGradient);
                break;

            case MinMaxGradientState.k_RandomBetweenTwoColors:
                GUIColor(rect, minMaxGradient.m_MaxColor);
                rect.y += rect.height;
                GUIColor(rect, minMaxGradient.m_MinColor);
                break;

            case MinMaxGradientState.k_RandomBetweenTwoGradients:
                EditorGUI.GradientField(rect, minMaxGradient.m_MaxGradient);
                rect.y += rect.height;
                EditorGUI.GradientField(rect, minMaxGradient.m_MinGradient);
                break;
            }
            GUIMMGradientPopUp(popupRect, minMaxGradient);
        }
        protected override void Init()
        {
            // Already initialized?
            if (m_Modes[0] != null)
            {
                return;
            }
            if (s_Texts == null)
            {
                s_Texts = new Texts();
            }

            for (int i = 0; i < k_NumCustomDataStreams; i++)
            {
                m_Modes[i] = GetProperty("mode" + i);
                m_VectorComponentCount[i] = GetProperty("vectorComponentCount" + i);
                m_Colors[i]      = new SerializedMinMaxGradient(this, "color" + i);
                m_ColorLabels[i] = GetProperty("colorLabel" + i);
                for (int j = 0; j < k_NumChannelsPerStream; j++)
                {
                    m_Vectors[i, j]      = new SerializedMinMaxCurve(this, GUIContent.none, "vector" + i + "_" + j, kUseSignedRange);
                    m_VectorLabels[i, j] = GetProperty("vectorLabel" + i + "_" + j);
                }
            }
        }
 protected override void Init()
 {
     if (s_Texts == null)
     {
         s_Texts = new Texts();
     }
     if (this.m_LengthInSec == null)
     {
         this.m_LengthInSec = base.GetProperty0("lengthInSec");
         this.m_Looping     = base.GetProperty0("looping");
         this.m_Prewarm     = base.GetProperty0("prewarm");
         this.m_StartDelay  = new SerializedMinMaxCurve(this, s_Texts.startDelay, "startDelay", false, true);
         this.m_StartDelay.m_AllowCurves = false;
         this.m_PlayOnAwake                    = base.GetProperty0("playOnAwake");
         this.m_SimulationSpace                = base.GetProperty0("moveWithTransform");
         this.m_ScalingMode                    = base.GetProperty0("scalingMode");
         this.m_LifeTime                       = new SerializedMinMaxCurve(this, s_Texts.lifetime, "startLifetime");
         this.m_Speed                          = new SerializedMinMaxCurve(this, s_Texts.speed, "startSpeed", ModuleUI.kUseSignedRange);
         this.m_Color                          = new SerializedMinMaxGradient(this, "startColor");
         this.m_Size                           = new SerializedMinMaxCurve(this, s_Texts.size, "startSize");
         this.m_Rotation3D                     = base.GetProperty("rotation3D");
         this.m_RotationX                      = new SerializedMinMaxCurve(this, s_Texts.x, "startRotationX", ModuleUI.kUseSignedRange);
         this.m_RotationY                      = new SerializedMinMaxCurve(this, s_Texts.y, "startRotationY", ModuleUI.kUseSignedRange);
         this.m_RotationZ                      = new SerializedMinMaxCurve(this, s_Texts.z, "startRotation", ModuleUI.kUseSignedRange);
         this.m_RotationX.m_RemapValue         = 57.29578f;
         this.m_RotationY.m_RemapValue         = 57.29578f;
         this.m_RotationZ.m_RemapValue         = 57.29578f;
         this.m_RotationX.m_DefaultCurveScalar = 3.141593f;
         this.m_RotationY.m_DefaultCurveScalar = 3.141593f;
         this.m_RotationZ.m_DefaultCurveScalar = 3.141593f;
         this.m_RandomizeRotationDirection     = base.GetProperty("randomizeRotationDirection");
         this.m_GravityModifier                = base.GetProperty("gravityModifier");
         this.m_MaxNumParticles                = base.GetProperty("maxNumParticles");
     }
 }
Example #5
0
        protected override void Init()
        {
            // Already initialized?
            if (m_Ratio != null)
            {
                return;
            }
            if (s_Texts == null)
            {
                s_Texts = new Texts();
            }

            m_Mode                   = GetProperty("mode");
            m_Ratio                  = GetProperty("ratio");
            m_Lifetime               = new SerializedMinMaxCurve(this, s_Texts.lifetime, "lifetime");
            m_MinVertexDistance      = GetProperty("minVertexDistance");
            m_TextureMode            = GetProperty("textureMode");
            m_WorldSpace             = GetProperty("worldSpace");
            m_DieWithParticles       = GetProperty("dieWithParticles");
            m_SizeAffectsWidth       = GetProperty("sizeAffectsWidth");
            m_SizeAffectsLifetime    = GetProperty("sizeAffectsLifetime");
            m_InheritParticleColor   = GetProperty("inheritParticleColor");
            m_ColorOverLifetime      = new SerializedMinMaxGradient(this, "colorOverLifetime");
            m_WidthOverTrail         = new SerializedMinMaxCurve(this, s_Texts.widthOverTrail, "widthOverTrail");
            m_ColorOverTrail         = new SerializedMinMaxGradient(this, "colorOverTrail");
            m_GenerateLightingData   = GetProperty("generateLightingData");
            m_RibbonCount            = GetProperty("ribbonCount");
            m_SplitSubEmitterRibbons = GetProperty("splitSubEmitterRibbons");
        }
Example #6
0
        public void GUIMinMaxGradient(GUIContent label, SerializedMinMaxGradient minMaxGradient)
        {
            MinMaxGradientState state = minMaxGradient.state;
            bool flag      = state >= MinMaxGradientState.k_RandomBetweenTwoColors;
            Rect rect      = GUILayoutUtility.GetRect(0f, (float)((!flag) ? 13 : 26));
            Rect popupRect = ModuleUI.GetPopupRect(rect);

            rect = ModuleUI.SubtractPopupWidth(rect);
            Rect rect2 = ModuleUI.PrefixLabel(rect, label);

            rect2.height = 13f;
            switch (state)
            {
            case MinMaxGradientState.k_Color:
                ModuleUI.GUIColor(rect2, minMaxGradient.m_MaxColor);
                break;

            case MinMaxGradientState.k_Gradient:
                EditorGUI.GradientField(rect2, minMaxGradient.m_MaxGradient);
                break;

            case MinMaxGradientState.k_RandomBetweenTwoColors:
                ModuleUI.GUIColor(rect2, minMaxGradient.m_MaxColor);
                rect2.y += rect2.height;
                ModuleUI.GUIColor(rect2, minMaxGradient.m_MinColor);
                break;

            case MinMaxGradientState.k_RandomBetweenTwoGradients:
                EditorGUI.GradientField(rect2, minMaxGradient.m_MaxGradient);
                rect2.y += rect2.height;
                EditorGUI.GradientField(rect2, minMaxGradient.m_MinGradient);
                break;
            }
            ModuleUI.GUIMMGradientPopUp(popupRect, minMaxGradient);
        }
		protected override void Init()
		{
			if (InitialModuleUI.s_Texts == null)
			{
				InitialModuleUI.s_Texts = new InitialModuleUI.Texts();
			}
			if (this.m_LengthInSec != null)
			{
				return;
			}
			this.m_LengthInSec = base.GetProperty0("lengthInSec");
			this.m_Looping = base.GetProperty0("looping");
			this.m_Prewarm = base.GetProperty0("prewarm");
			this.m_StartDelay = base.GetProperty0("startDelay");
			this.m_PlayOnAwake = base.GetProperty0("playOnAwake");
			this.m_SimulationSpace = base.GetProperty0("moveWithTransform");
			this.m_LifeTime = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.lifetime, "startLifetime");
			this.m_Speed = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.speed, "startSpeed", ModuleUI.kUseSignedRange);
			this.m_Color = new SerializedMinMaxGradient(this, "startColor");
			this.m_Size = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.size, "startSize");
			this.m_Rotation = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.rotation, "startRotation", ModuleUI.kUseSignedRange);
			this.m_Rotation.m_RemapValue = 57.29578f;
			this.m_Rotation.m_DefaultCurveScalar = 3.14159274f;
			this.m_GravityModifier = base.GetProperty("gravityModifier");
			this.m_InheritVelocity = base.GetProperty("inheritVelocity");
			this.m_MaxNumParticles = base.GetProperty("maxNumParticles");
		}
Example #8
0
        public static void GUIMMGradientPopUp(Rect rect, SerializedMinMaxGradient gradientProp)
        {
            if (!EditorGUI.ButtonMouseDown(rect, GUIContent.none, FocusType.Passive, ParticleSystemStyles.Get().minMaxCurveStateDropDown))
            {
                return;
            }
            GUIContent[] guiContentArray = new GUIContent[4] {
                new GUIContent("Color"), new GUIContent("Gradient"), new GUIContent("Random Between Two Colors"), new GUIContent("Random Between Two Gradients")
            };
            MinMaxGradientState[] maxGradientStateArray = new MinMaxGradientState[4] {
                MinMaxGradientState.k_Color, MinMaxGradientState.k_Gradient, MinMaxGradientState.k_RandomBetweenTwoColors, MinMaxGradientState.k_RandomBetweenTwoGradients
            };
            bool[] flagArray = new bool[4] {
                (gradientProp.m_AllowColor ? 1 : 0) != 0, (gradientProp.m_AllowGradient ? 1 : 0) != 0, (gradientProp.m_AllowRandomBetweenTwoColors ? 1 : 0) != 0, (gradientProp.m_AllowRandomBetweenTwoGradients ? 1 : 0) != 0
            };
            GenericMenu genericMenu = new GenericMenu();

            for (int index = 0; index < guiContentArray.Length; ++index)
            {
                if (flagArray[index])
                {
                    genericMenu.AddItem(guiContentArray[index], gradientProp.state == maxGradientStateArray[index], new GenericMenu.MenuFunction2(ModuleUI.SelectMinMaxGradientStateCallback), (object)new ModuleUI.GradientCallbackData(maxGradientStateArray[index], gradientProp));
                }
            }
            genericMenu.ShowAsContext();
            Event.current.Use();
        }
Example #9
0
 protected override void Init()
 {
     if (s_Texts == null)
     {
         s_Texts = new Texts();
     }
     if (this.m_LengthInSec == null)
     {
         this.m_LengthInSec                   = base.GetProperty0("lengthInSec");
         this.m_Looping                       = base.GetProperty0("looping");
         this.m_Prewarm                       = base.GetProperty0("prewarm");
         this.m_StartDelay                    = base.GetProperty0("startDelay");
         this.m_PlayOnAwake                   = base.GetProperty0("playOnAwake");
         this.m_SimulationSpace               = base.GetProperty0("moveWithTransform");
         this.m_LifeTime                      = new SerializedMinMaxCurve(this, s_Texts.lifetime, "startLifetime");
         this.m_Speed                         = new SerializedMinMaxCurve(this, s_Texts.speed, "startSpeed", ModuleUI.kUseSignedRange);
         this.m_Color                         = new SerializedMinMaxGradient(this, "startColor");
         this.m_Size                          = new SerializedMinMaxCurve(this, s_Texts.size, "startSize");
         this.m_Rotation                      = new SerializedMinMaxCurve(this, s_Texts.rotation, "startRotation", ModuleUI.kUseSignedRange);
         this.m_Rotation.m_RemapValue         = 57.29578f;
         this.m_Rotation.m_DefaultCurveScalar = 3.141593f;
         this.m_GravityModifier               = base.GetProperty("gravityModifier");
         this.m_InheritVelocity               = base.GetProperty("inheritVelocity");
         this.m_MaxNumParticles               = base.GetProperty("maxNumParticles");
     }
 }
 protected override void Init()
 {
   if (InitialModuleUI.s_Texts == null)
     InitialModuleUI.s_Texts = new InitialModuleUI.Texts();
   if (this.m_LengthInSec != null)
     return;
   this.m_LengthInSec = this.GetProperty0("lengthInSec");
   this.m_Looping = this.GetProperty0("looping");
   this.m_Prewarm = this.GetProperty0("prewarm");
   this.m_StartDelay = new SerializedMinMaxCurve((ModuleUI) this, InitialModuleUI.s_Texts.startDelay, "startDelay", false, true);
   this.m_StartDelay.m_AllowCurves = false;
   this.m_PlayOnAwake = this.GetProperty0("playOnAwake");
   this.m_SimulationSpace = this.GetProperty0("moveWithTransform");
   this.m_ScalingMode = this.GetProperty0("scalingMode");
   this.m_LifeTime = new SerializedMinMaxCurve((ModuleUI) this, InitialModuleUI.s_Texts.lifetime, "startLifetime");
   this.m_Speed = new SerializedMinMaxCurve((ModuleUI) this, InitialModuleUI.s_Texts.speed, "startSpeed", ModuleUI.kUseSignedRange);
   this.m_Color = new SerializedMinMaxGradient((SerializedModule) this, "startColor");
   this.m_Size = new SerializedMinMaxCurve((ModuleUI) this, InitialModuleUI.s_Texts.size, "startSize");
   this.m_Rotation3D = this.GetProperty("rotation3D");
   this.m_RotationX = new SerializedMinMaxCurve((ModuleUI) this, InitialModuleUI.s_Texts.x, "startRotationX", ModuleUI.kUseSignedRange);
   this.m_RotationY = new SerializedMinMaxCurve((ModuleUI) this, InitialModuleUI.s_Texts.y, "startRotationY", ModuleUI.kUseSignedRange);
   this.m_RotationZ = new SerializedMinMaxCurve((ModuleUI) this, InitialModuleUI.s_Texts.z, "startRotation", ModuleUI.kUseSignedRange);
   this.m_RotationX.m_RemapValue = 57.29578f;
   this.m_RotationY.m_RemapValue = 57.29578f;
   this.m_RotationZ.m_RemapValue = 57.29578f;
   this.m_RotationX.m_DefaultCurveScalar = 3.141593f;
   this.m_RotationY.m_DefaultCurveScalar = 3.141593f;
   this.m_RotationZ.m_DefaultCurveScalar = 3.141593f;
   this.m_RandomizeRotationDirection = this.GetProperty("randomizeRotationDirection");
   this.m_GravityModifier = this.GetProperty("gravityModifier");
   this.m_MaxNumParticles = this.GetProperty("maxNumParticles");
 }
 protected override void Init()
 {
   if (this.m_Gradient != null)
     return;
   this.m_Gradient = new SerializedMinMaxGradient((SerializedModule) this);
   this.m_Gradient.m_AllowColor = false;
   this.m_Gradient.m_AllowRandomBetweenTwoColors = false;
 }
Example #12
0
 protected override void Init()
 {
     if (this.m_Gradient == null)
     {
         this.m_Gradient = new SerializedMinMaxGradient(this);
         this.m_Gradient.m_AllowColor = false;
         this.m_Gradient.m_AllowRandomBetweenTwoColors = false;
     }
 }
        protected override void Init()
        {
            // Already initialized?
            if (m_LengthInSec != null)
            {
                return;
            }
            if (s_Texts == null)
            {
                s_Texts = new Texts();
            }

            // general emitter state
            m_LengthInSec = GetProperty0("lengthInSec");
            m_Looping     = GetProperty0("looping");
            m_Prewarm     = GetProperty0("prewarm");
            m_StartDelay  = new SerializedMinMaxCurve(this, s_Texts.startDelay, "startDelay", false, true);
            m_StartDelay.m_AllowCurves = false;
            m_PlayOnAwake           = GetProperty0("playOnAwake");
            m_SimulationSpace       = GetProperty0("moveWithTransform");
            m_CustomSimulationSpace = GetProperty0("moveWithCustomTransform");
            m_SimulationSpeed       = GetProperty0("simulationSpeed");
            m_UseUnscaledTime       = GetProperty0("useUnscaledTime");
            m_ScalingMode           = GetProperty0("scalingMode");
            m_EmitterVelocityMode   = GetProperty0("emitterVelocityMode");
            m_AutoRandomSeed        = GetProperty0("autoRandomSeed");
            m_RandomSeed            = GetProperty0("randomSeed");
            m_StopAction            = GetProperty0("stopAction");
            m_CullingMode           = GetProperty0("cullingMode");
            m_RingBufferMode        = GetProperty0("ringBufferMode");
            m_RingBufferLoopRange   = GetProperty0("ringBufferLoopRange");

            // module properties
            m_EmitterVelocity                = GetProperty("customEmitterVelocity");
            m_LifeTime                       = new SerializedMinMaxCurve(this, s_Texts.lifetime, "startLifetime");
            m_Speed                          = new SerializedMinMaxCurve(this, s_Texts.speed, "startSpeed", kUseSignedRange);
            m_Color                          = new SerializedMinMaxGradient(this, "startColor");
            m_Color.m_AllowRandomColor       = true;
            m_Size3D                         = GetProperty("size3D");
            m_SizeX                          = new SerializedMinMaxCurve(this, s_Texts.x, "startSize");
            m_SizeY                          = new SerializedMinMaxCurve(this, s_Texts.y, "startSizeY", false, false, m_Size3D.boolValue);
            m_SizeZ                          = new SerializedMinMaxCurve(this, s_Texts.z, "startSizeZ", false, false, m_Size3D.boolValue);
            m_Rotation3D                     = GetProperty("rotation3D");
            m_RotationX                      = new SerializedMinMaxCurve(this, s_Texts.x, "startRotationX", kUseSignedRange, false, m_Rotation3D.boolValue);
            m_RotationY                      = new SerializedMinMaxCurve(this, s_Texts.y, "startRotationY", kUseSignedRange, false, m_Rotation3D.boolValue);
            m_RotationZ                      = new SerializedMinMaxCurve(this, s_Texts.z, "startRotation", kUseSignedRange);
            m_RotationX.m_RemapValue         = Mathf.Rad2Deg;
            m_RotationY.m_RemapValue         = Mathf.Rad2Deg;
            m_RotationZ.m_RemapValue         = Mathf.Rad2Deg;
            m_RotationX.m_DefaultCurveScalar = Mathf.PI;
            m_RotationY.m_DefaultCurveScalar = Mathf.PI;
            m_RotationZ.m_DefaultCurveScalar = Mathf.PI;
            m_RandomizeRotationDirection     = GetProperty("randomizeRotationDirection");
            m_GravitySource                  = GetProperty("gravitySource");
            m_GravityModifier                = new SerializedMinMaxCurve(this, s_Texts.gravity, "gravityModifier", kUseSignedRange);
            m_MaxNumParticles                = GetProperty("maxNumParticles");
        }
 protected override void Init()
 {
     if (this.m_Gradient == null)
     {
         this.m_Gradient = new SerializedMinMaxGradient(this);
         this.m_Gradient.m_AllowColor = false;
         this.m_Gradient.m_AllowRandomBetweenTwoColors = false;
         this.m_Range = base.GetProperty("range");
     }
 }
 protected override void Init()
 {
     if (this.m_Gradient == null)
     {
         this.m_Gradient = new SerializedMinMaxGradient(this);
         this.m_Gradient.m_AllowColor = false;
         this.m_Gradient.m_AllowRandomBetweenTwoColors = false;
         this.m_Range = base.GetProperty("range");
     }
 }
Example #16
0
 protected override void Init()
 {
     if (this.m_Gradient != null)
     {
         return;
     }
     this.m_Gradient = new SerializedMinMaxGradient((SerializedModule)this);
     this.m_Gradient.m_AllowColor = false;
     this.m_Gradient.m_AllowRandomBetweenTwoColors = false;
 }
Example #17
0
 protected override void Init()
 {
     if (this.m_Gradient == null)
     {
         if (ColorModuleUI.s_Texts == null)
         {
             ColorModuleUI.s_Texts = new ColorModuleUI.Texts();
         }
         this.m_Gradient = new SerializedMinMaxGradient(this);
         this.m_Gradient.m_AllowColor = false;
         this.m_Gradient.m_AllowRandomBetweenTwoColors = false;
     }
 }
		protected override void Init()
		{
			if (this.m_Gradient == null)
			{
				if (ColorByVelocityModuleUI.s_Texts == null)
				{
					ColorByVelocityModuleUI.s_Texts = new ColorByVelocityModuleUI.Texts();
				}
				this.m_Gradient = new SerializedMinMaxGradient(this);
				this.m_Gradient.m_AllowColor = false;
				this.m_Gradient.m_AllowRandomBetweenTwoColors = false;
				this.m_Range = base.GetProperty("range");
			}
		}
Example #19
0
        private static void GUIGradientAsColor(Rect rect, SerializedProperty gradientProp)
        {
            bool changed = GUI.changed;

            GUI.changed = false;
            Color color = SerializedMinMaxGradient.GetGradientAsColor(gradientProp);

            color = EditorGUI.ColorField(rect, color, false, true);
            if (GUI.changed)
            {
                SerializedMinMaxGradient.SetGradientAsColor(gradientProp, color);
            }
            GUI.changed |= changed;
        }
        protected override void Init()
        {
            // Already initialized?
            if (m_Gradient != null)
            {
                return;
            }
            if (s_Texts == null)
            {
                s_Texts = new Texts();
            }

            m_Gradient = new SerializedMinMaxGradient(this);
            m_Gradient.m_AllowColor = false;
            m_Gradient.m_AllowRandomBetweenTwoColors = false;
        }
Example #21
0
 public static void GUIMMGradientPopUp(Rect rect, SerializedMinMaxGradient gradientProp)
 {
     if (EditorGUI.ButtonMouseDown(rect, GUIContent.none, FocusType.Passive, ParticleSystemStyles.Get().minMaxCurveStateDropDown))
     {
         GUIContent[] array = new GUIContent[]
         {
             new GUIContent("Color"),
             new GUIContent("Gradient"),
             new GUIContent("Random Between Two Colors"),
             new GUIContent("Random Between Two Gradients"),
             new GUIContent("Random Color")
         };
         MinMaxGradientState[] array2 = new MinMaxGradientState[]
         {
             MinMaxGradientState.k_Color,
             MinMaxGradientState.k_Gradient,
             MinMaxGradientState.k_RandomBetweenTwoColors,
             MinMaxGradientState.k_RandomBetweenTwoGradients,
             MinMaxGradientState.k_RandomColor
         };
         bool[] array3 = new bool[]
         {
             gradientProp.m_AllowColor,
             gradientProp.m_AllowGradient,
             gradientProp.m_AllowRandomBetweenTwoColors,
             gradientProp.m_AllowRandomBetweenTwoGradients,
             gradientProp.m_AllowRandomColor
         };
         GenericMenu genericMenu = new GenericMenu();
         for (int i = 0; i < array.Length; i++)
         {
             if (array3[i])
             {
                 GenericMenu arg_FB_0 = genericMenu;
                 GUIContent  arg_FB_1 = array[i];
                 bool        arg_FB_2 = gradientProp.state == array2[i];
                 if (ModuleUI.< > f__mg$cache1 == null)
                 {
                     ModuleUI.< > f__mg$cache1 = new GenericMenu.MenuFunction2(ModuleUI.SelectMinMaxGradientStateCallback);
                 }
                 arg_FB_0.AddItem(arg_FB_1, arg_FB_2, ModuleUI.< > f__mg$cache1, new ModuleUI.GradientCallbackData(array2[i], gradientProp));
             }
         }
         genericMenu.ShowAsContext();
         Event.current.Use();
     }
 }
Example #22
0
 protected override void Init()
 {
     if (this.m_LengthInSec == null)
     {
         if (InitialModuleUI.s_Texts == null)
         {
             InitialModuleUI.s_Texts = new InitialModuleUI.Texts();
         }
         this.m_LengthInSec = base.GetProperty0("lengthInSec");
         this.m_Looping     = base.GetProperty0("looping");
         this.m_Prewarm     = base.GetProperty0("prewarm");
         this.m_StartDelay  = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.startDelay, "startDelay", false, true);
         this.m_StartDelay.m_AllowCurves = false;
         this.m_PlayOnAwake           = base.GetProperty0("playOnAwake");
         this.m_SimulationSpace       = base.GetProperty0("moveWithTransform");
         this.m_CustomSimulationSpace = base.GetProperty0("moveWithCustomTransform");
         this.m_SimulationSpeed       = base.GetProperty0("simulationSpeed");
         this.m_UseUnscaledTime       = base.GetProperty0("useUnscaledTime");
         this.m_ScalingMode           = base.GetProperty0("scalingMode");
         this.m_EmitterVelocity       = base.GetProperty0("useRigidbodyForVelocity");
         this.m_AutoRandomSeed        = base.GetProperty0("autoRandomSeed");
         this.m_RandomSeed            = base.GetProperty0("randomSeed");
         this.m_StopAction            = base.GetProperty0("stopAction");
         this.m_LifeTime = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.lifetime, "startLifetime");
         this.m_Speed    = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.speed, "startSpeed", ModuleUI.kUseSignedRange);
         this.m_Color    = new SerializedMinMaxGradient(this, "startColor");
         this.m_Color.m_AllowRandomColor = true;
         this.m_Size3D                         = base.GetProperty("size3D");
         this.m_SizeX                          = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.x, "startSize");
         this.m_SizeY                          = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.y, "startSizeY", false, false, this.m_Size3D.boolValue);
         this.m_SizeZ                          = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.z, "startSizeZ", false, false, this.m_Size3D.boolValue);
         this.m_Rotation3D                     = base.GetProperty("rotation3D");
         this.m_RotationX                      = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.x, "startRotationX", ModuleUI.kUseSignedRange, false, this.m_Rotation3D.boolValue);
         this.m_RotationY                      = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.y, "startRotationY", ModuleUI.kUseSignedRange, false, this.m_Rotation3D.boolValue);
         this.m_RotationZ                      = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.z, "startRotation", ModuleUI.kUseSignedRange);
         this.m_RotationX.m_RemapValue         = 57.29578f;
         this.m_RotationY.m_RemapValue         = 57.29578f;
         this.m_RotationZ.m_RemapValue         = 57.29578f;
         this.m_RotationX.m_DefaultCurveScalar = 3.14159274f;
         this.m_RotationY.m_DefaultCurveScalar = 3.14159274f;
         this.m_RotationZ.m_DefaultCurveScalar = 3.14159274f;
         this.m_RandomizeRotationDirection     = base.GetProperty("randomizeRotationDirection");
         this.m_GravityModifier                = new SerializedMinMaxCurve(this, InitialModuleUI.s_Texts.gravity, "gravityModifier", ModuleUI.kUseSignedRange);
         this.m_MaxNumParticles                = base.GetProperty("maxNumParticles");
     }
 }
 protected override void Init()
 {
     if (s_Texts == null)
     {
         s_Texts = new Texts();
     }
     if (this.m_LengthInSec == null)
     {
         this.m_LengthInSec = base.GetProperty0("lengthInSec");
         this.m_Looping = base.GetProperty0("looping");
         this.m_Prewarm = base.GetProperty0("prewarm");
         this.m_StartDelay = new SerializedMinMaxCurve(this, s_Texts.startDelay, "startDelay", false, true);
         this.m_StartDelay.m_AllowCurves = false;
         this.m_PlayOnAwake = base.GetProperty0("playOnAwake");
         this.m_SimulationSpace = base.GetProperty0("moveWithTransform");
         this.m_CustomSimulationSpace = base.GetProperty0("moveWithCustomTransform");
         this.m_SimulationSpeed = base.GetProperty0("simulationSpeed");
         this.m_ScalingMode = base.GetProperty0("scalingMode");
         this.m_AutoRandomSeed = base.GetProperty0("autoRandomSeed");
         this.m_RandomSeed = base.GetProperty0("randomSeed");
         this.m_LifeTime = new SerializedMinMaxCurve(this, s_Texts.lifetime, "startLifetime");
         this.m_Speed = new SerializedMinMaxCurve(this, s_Texts.speed, "startSpeed", ModuleUI.kUseSignedRange);
         this.m_Color = new SerializedMinMaxGradient(this, "startColor");
         this.m_Color.m_AllowRandomColor = true;
         this.m_Size3D = base.GetProperty("size3D");
         this.m_SizeX = new SerializedMinMaxCurve(this, s_Texts.x, "startSize");
         this.m_SizeY = new SerializedMinMaxCurve(this, s_Texts.y, "startSizeY");
         this.m_SizeZ = new SerializedMinMaxCurve(this, s_Texts.z, "startSizeZ");
         this.m_Rotation3D = base.GetProperty("rotation3D");
         this.m_RotationX = new SerializedMinMaxCurve(this, s_Texts.x, "startRotationX", ModuleUI.kUseSignedRange);
         this.m_RotationY = new SerializedMinMaxCurve(this, s_Texts.y, "startRotationY", ModuleUI.kUseSignedRange);
         this.m_RotationZ = new SerializedMinMaxCurve(this, s_Texts.z, "startRotation", ModuleUI.kUseSignedRange);
         this.m_RotationX.m_RemapValue = 57.29578f;
         this.m_RotationY.m_RemapValue = 57.29578f;
         this.m_RotationZ.m_RemapValue = 57.29578f;
         this.m_RotationX.m_DefaultCurveScalar = 3.141593f;
         this.m_RotationY.m_DefaultCurveScalar = 3.141593f;
         this.m_RotationZ.m_DefaultCurveScalar = 3.141593f;
         this.m_RandomizeRotationDirection = base.GetProperty("randomizeRotationDirection");
         this.m_GravityModifier = new SerializedMinMaxCurve(this, s_Texts.gravity, "gravityModifier", ModuleUI.kUseSignedRange);
         this.m_MaxNumParticles = base.GetProperty("maxNumParticles");
     }
 }
 protected override void Init()
 {
     if (this.m_Ratio == null)
     {
         if (s_Texts == null)
         {
             s_Texts = new Texts();
         }
         this.m_Ratio = base.GetProperty("ratio");
         this.m_Lifetime = new SerializedMinMaxCurve(this, s_Texts.lifetime, "lifetime");
         this.m_MinVertexDistance = base.GetProperty("minVertexDistance");
         this.m_TextureMode = base.GetProperty("textureMode");
         this.m_WorldSpace = base.GetProperty("worldSpace");
         this.m_DieWithParticles = base.GetProperty("dieWithParticles");
         this.m_SizeAffectsWidth = base.GetProperty("sizeAffectsWidth");
         this.m_SizeAffectsLifetime = base.GetProperty("sizeAffectsLifetime");
         this.m_InheritParticleColor = base.GetProperty("inheritParticleColor");
         this.m_ColorOverLifetime = new SerializedMinMaxGradient(this, "colorOverLifetime");
         this.m_WidthOverTrail = new SerializedMinMaxCurve(this, s_Texts.widthOverTrail, "widthOverTrail");
         this.m_ColorOverTrail = new SerializedMinMaxGradient(this, "colorOverTrail");
     }
 }
Example #25
0
 protected override void Init()
 {
     if (this.m_Ratio == null)
     {
         if (s_Texts == null)
         {
             s_Texts = new Texts();
         }
         this.m_Ratio                = base.GetProperty("ratio");
         this.m_Lifetime             = new SerializedMinMaxCurve(this, s_Texts.lifetime, "lifetime");
         this.m_MinVertexDistance    = base.GetProperty("minVertexDistance");
         this.m_TextureMode          = base.GetProperty("textureMode");
         this.m_WorldSpace           = base.GetProperty("worldSpace");
         this.m_DieWithParticles     = base.GetProperty("dieWithParticles");
         this.m_SizeAffectsWidth     = base.GetProperty("sizeAffectsWidth");
         this.m_SizeAffectsLifetime  = base.GetProperty("sizeAffectsLifetime");
         this.m_InheritParticleColor = base.GetProperty("inheritParticleColor");
         this.m_ColorOverLifetime    = new SerializedMinMaxGradient(this, "colorOverLifetime");
         this.m_WidthOverTrail       = new SerializedMinMaxCurve(this, s_Texts.widthOverTrail, "widthOverTrail");
         this.m_ColorOverTrail       = new SerializedMinMaxGradient(this, "colorOverTrail");
     }
 }
Example #26
0
 public static void GUIMMGradientPopUp(Rect rect, SerializedMinMaxGradient gradientProp)
 {
     if (EditorGUI.ButtonMouseDown(rect, GUIContent.none, FocusType.Passive, ParticleSystemStyles.Get().minMaxCurveStateDropDown))
     {
         GUIContent[]          contentArray = new GUIContent[] { new GUIContent("Color"), new GUIContent("Gradient"), new GUIContent("Random Between Two Colors"), new GUIContent("Random Between Two Gradients") };
         MinMaxGradientState[] stateArray1  = new MinMaxGradientState[4];
         stateArray1[1] = MinMaxGradientState.k_Gradient;
         stateArray1[2] = MinMaxGradientState.k_RandomBetweenTwoColors;
         stateArray1[3] = MinMaxGradientState.k_RandomBetweenTwoGradients;
         MinMaxGradientState[] stateArray = stateArray1;
         bool[]      flagArray            = new bool[] { gradientProp.m_AllowColor, gradientProp.m_AllowGradient, gradientProp.m_AllowRandomBetweenTwoColors, gradientProp.m_AllowRandomBetweenTwoGradients };
         GenericMenu menu = new GenericMenu();
         for (int i = 0; i < contentArray.Length; i++)
         {
             if (flagArray[i])
             {
                 menu.AddItem(contentArray[i], gradientProp.state == stateArray[i], new GenericMenu.MenuFunction2(ModuleUI.SelectMinMaxGradientStateCallback), new GradientCallbackData(stateArray[i], gradientProp));
             }
         }
         menu.ShowAsContext();
         Event.current.Use();
     }
 }
Example #27
0
 public GradientCallbackData(MinMaxGradientState state, SerializedMinMaxGradient p)
 {
   this.gradientProp = p;
   this.selectedState = state;
 }
Example #28
0
 public static void GUIMMGradientPopUp(Rect rect, SerializedMinMaxGradient gradientProp)
 {
   if (!EditorGUI.ButtonMouseDown(rect, GUIContent.none, FocusType.Passive, ParticleSystemStyles.Get().minMaxCurveStateDropDown))
     return;
   GUIContent[] guiContentArray = new GUIContent[4]{ new GUIContent("Color"), new GUIContent("Gradient"), new GUIContent("Random Between Two Colors"), new GUIContent("Random Between Two Gradients") };
   MinMaxGradientState[] maxGradientStateArray = new MinMaxGradientState[4]{ MinMaxGradientState.k_Color, MinMaxGradientState.k_Gradient, MinMaxGradientState.k_RandomBetweenTwoColors, MinMaxGradientState.k_RandomBetweenTwoGradients };
   bool[] flagArray = new bool[4]{ (gradientProp.m_AllowColor ? 1 : 0) != 0, (gradientProp.m_AllowGradient ? 1 : 0) != 0, (gradientProp.m_AllowRandomBetweenTwoColors ? 1 : 0) != 0, (gradientProp.m_AllowRandomBetweenTwoGradients ? 1 : 0) != 0 };
   GenericMenu genericMenu = new GenericMenu();
   for (int index = 0; index < guiContentArray.Length; ++index)
   {
     if (flagArray[index])
       genericMenu.AddItem(guiContentArray[index], gradientProp.state == maxGradientStateArray[index], new GenericMenu.MenuFunction2(ModuleUI.SelectMinMaxGradientStateCallback), (object) new ModuleUI.GradientCallbackData(maxGradientStateArray[index], gradientProp));
   }
   genericMenu.ShowAsContext();
   Event.current.Use();
 }
Example #29
0
 public void GUIMinMaxGradient(GUIContent label, SerializedMinMaxGradient minMaxGradient)
 {
   MinMaxGradientState state = minMaxGradient.state;
   Rect rect1 = GUILayoutUtility.GetRect(0.0f, state < MinMaxGradientState.k_RandomBetweenTwoColors ? 13f : 26f);
   Rect popupRect = ModuleUI.GetPopupRect(rect1);
   Rect rect2 = ModuleUI.PrefixLabel(ModuleUI.SubtractPopupWidth(rect1), label);
   rect2.height = 13f;
   switch (state)
   {
     case MinMaxGradientState.k_Color:
       ModuleUI.GUIColor(rect2, minMaxGradient.m_MaxColor);
       break;
     case MinMaxGradientState.k_Gradient:
       EditorGUI.GradientField(rect2, minMaxGradient.m_MaxGradient);
       break;
     case MinMaxGradientState.k_RandomBetweenTwoColors:
       ModuleUI.GUIColor(rect2, minMaxGradient.m_MaxColor);
       rect2.y += rect2.height;
       ModuleUI.GUIColor(rect2, minMaxGradient.m_MinColor);
       break;
     case MinMaxGradientState.k_RandomBetweenTwoGradients:
       EditorGUI.GradientField(rect2, minMaxGradient.m_MaxGradient);
       rect2.y += rect2.height;
       EditorGUI.GradientField(rect2, minMaxGradient.m_MinGradient);
       break;
   }
   ModuleUI.GUIMMGradientPopUp(popupRect, minMaxGradient);
 }
Example #30
0
 public GradientCallbackData(MinMaxGradientState state, SerializedMinMaxGradient p)
 {
     this.gradientProp  = p;
     this.selectedState = state;
 }
Example #31
0
        public void GUIMinMaxGradient(GUIContent label, SerializedMinMaxGradient minMaxGradient)
        {
            MinMaxGradientState state = minMaxGradient.state;
            bool flag = state >= MinMaxGradientState.k_RandomBetweenTwoColors;
            Rect position = GUILayoutUtility.GetRect(0f, !flag ? ((float) 13) : ((float) 0x1a));
            Rect popupRect = GetPopupRect(position);
            Rect rect = PrefixLabel(SubtractPopupWidth(position), label);
            rect.height = 13f;
            switch (state)
            {
                case MinMaxGradientState.k_Color:
                    GUIColor(rect, minMaxGradient.m_MaxColor);
                    break;

                case MinMaxGradientState.k_Gradient:
                    EditorGUI.GradientField(rect, minMaxGradient.m_MaxGradient);
                    break;

                case MinMaxGradientState.k_RandomBetweenTwoColors:
                    GUIColor(rect, minMaxGradient.m_MaxColor);
                    rect.y += rect.height;
                    GUIColor(rect, minMaxGradient.m_MinColor);
                    break;

                case MinMaxGradientState.k_RandomBetweenTwoGradients:
                    EditorGUI.GradientField(rect, minMaxGradient.m_MaxGradient);
                    rect.y += rect.height;
                    EditorGUI.GradientField(rect, minMaxGradient.m_MinGradient);
                    break;
            }
            GUIMMGradientPopUp(popupRect, minMaxGradient);
        }
Example #32
0
 public static void GUIMMGradientPopUp(Rect rect, SerializedMinMaxGradient gradientProp)
 {
     if (EditorGUI.ButtonMouseDown(rect, GUIContent.none, FocusType.Passive, ParticleSystemStyles.Get().minMaxCurveStateDropDown))
     {
         GUIContent[] contentArray = new GUIContent[] { new GUIContent("Color"), new GUIContent("Gradient"), new GUIContent("Random Between Two Colors"), new GUIContent("Random Between Two Gradients") };
         MinMaxGradientState[] stateArray1 = new MinMaxGradientState[4];
         stateArray1[1] = MinMaxGradientState.k_Gradient;
         stateArray1[2] = MinMaxGradientState.k_RandomBetweenTwoColors;
         stateArray1[3] = MinMaxGradientState.k_RandomBetweenTwoGradients;
         MinMaxGradientState[] stateArray = stateArray1;
         bool[] flagArray = new bool[] { gradientProp.m_AllowColor, gradientProp.m_AllowGradient, gradientProp.m_AllowRandomBetweenTwoColors, gradientProp.m_AllowRandomBetweenTwoGradients };
         GenericMenu menu = new GenericMenu();
         for (int i = 0; i < contentArray.Length; i++)
         {
             if (flagArray[i])
             {
                 menu.AddItem(contentArray[i], gradientProp.state == stateArray[i], new GenericMenu.MenuFunction2(ModuleUI.SelectMinMaxGradientStateCallback), new GradientCallbackData(stateArray[i], gradientProp));
             }
         }
         menu.ShowAsContext();
         Event.current.Use();
     }
 }