Exemplo n.º 1
0
 public void DisableVertexStreams(ParticleSystemVertexStreams streams)
 {
     this.Internal_SetVertexStreams(streams, false);
 }
Exemplo n.º 2
0
        private void DoVertexStreamsGUI(RendererModuleUI.RenderMode renderMode)
        {
            Rect controlRect = ModuleUI.GetControlRect(13, new GUILayoutOption[0]);

            GUI.Label(controlRect, RendererModuleUI.s_Texts.streams, ParticleSystemStyles.Get().label);
            int num = 0;

            for (int i = 0; i < RendererModuleUI.s_Texts.vertexStreams.Length; i++)
            {
                if ((this.m_VertexStreamMask.intValue & 1 << i) != 0)
                {
                    bool   flag     = this.m_ParticleSystemUI.m_ParticleEffectUI.m_Owner is ParticleSystemInspector;
                    string text     = (!flag) ? "TEX" : "TEXCOORD";
                    Rect   position = new Rect(controlRect.x + EditorGUIUtility.labelWidth, controlRect.y, controlRect.width, controlRect.height);
                    if (RendererModuleUI.s_Texts.vertexStreamIsTexCoord[i])
                    {
                        GUI.Label(position, string.Concat(new object[]
                        {
                            RendererModuleUI.s_Texts.vertexStreams[i],
                            " (",
                            text,
                            num++,
                            ", ",
                            RendererModuleUI.s_Texts.vertexStreamDataTypes[i],
                            ")"
                        }), ParticleSystemStyles.Get().label);
                    }
                    else
                    {
                        GUI.Label(position, RendererModuleUI.s_Texts.vertexStreams[i] + " (" + RendererModuleUI.s_Texts.vertexStreamDataTypes[i] + ")", ParticleSystemStyles.Get().label);
                    }
                    position.x  = controlRect.xMax - 12f;
                    controlRect = ModuleUI.GetControlRect(13, new GUILayoutOption[0]);
                    if (i == 0)
                    {
                        if (this.m_VertexStreamMask.intValue != (1 << RendererModuleUI.s_Texts.vertexStreams.Length) - 1)
                        {
                            position.x -= 2f;
                            position.y -= 2f;
                            if (EditorGUI.ButtonMouseDown(position, GUIContent.none, FocusType.Passive, "OL Plus"))
                            {
                                List <GUIContent> list = new List <GUIContent>();
                                for (int j = 0; j < RendererModuleUI.s_Texts.vertexStreams.Length; j++)
                                {
                                    if ((this.m_VertexStreamMask.intValue & 1 << j) == 0)
                                    {
                                        list.Add(new GUIContent(RendererModuleUI.s_Texts.vertexStreams[j]));
                                    }
                                }
                                GenericMenu genericMenu = new GenericMenu();
                                for (int k = 0; k < list.Count; k++)
                                {
                                    GenericMenu arg_292_0 = genericMenu;
                                    GUIContent  arg_292_1 = list[k];
                                    bool        arg_292_2 = false;
                                    if (RendererModuleUI.< > f__mg$cache0 == null)
                                    {
                                        RendererModuleUI.< > f__mg$cache0 = new GenericMenu.MenuFunction2(RendererModuleUI.SelectVertexStreamCallback);
                                    }
                                    arg_292_0.AddItem(arg_292_1, arg_292_2, RendererModuleUI.< > f__mg$cache0, new RendererModuleUI.StreamCallbackData(this.m_VertexStreamMask, list[k].text));
                                }
                                genericMenu.ShowAsContext();
                                Event.current.Use();
                            }
                        }
                    }
                    else if (ModuleUI.MinusButton(position))
                    {
                        this.m_VertexStreamMask.intValue &= ~(1 << i);
                    }
                }
            }
            string text2 = "";

            if (this.m_Material != null)
            {
                Material material = this.m_Material.objectReferenceValue as Material;
                ParticleSystemVertexStreams particleSystemVertexStreams = this.m_ParticleSystemUI.m_ParticleSystem.CheckVertexStreamsMatchShader((ParticleSystemVertexStreams)this.m_VertexStreamMask.intValue, material);
                if (particleSystemVertexStreams != ParticleSystemVertexStreams.None)
                {
                    text2 += "Vertex streams do not match the shader inputs. Particle systems may not render correctly. Ensure your streams match and are used by the shader.";
                    if ((particleSystemVertexStreams & ParticleSystemVertexStreams.Tangent) != ParticleSystemVertexStreams.None)
                    {
                        text2 += "\n- TANGENT stream does not match.";
                    }
                    if ((particleSystemVertexStreams & ParticleSystemVertexStreams.Color) != ParticleSystemVertexStreams.None)
                    {
                        text2 += "\n- COLOR stream does not match.";
                    }
                    if ((particleSystemVertexStreams & ParticleSystemVertexStreams.UV) != ParticleSystemVertexStreams.None)
                    {
                        text2 += "\n- TEXCOORD streams do not match.";
                    }
                }
            }
            int maxTexCoordStreams = this.m_ParticleSystemUI.m_ParticleSystem.GetMaxTexCoordStreams();

            if (num > maxTexCoordStreams)
            {
                if (text2 != "")
                {
                    text2 += "\n\n";
                }
                string text3 = text2;
                text2 = string.Concat(new object[]
                {
                    text3,
                    "Only ",
                    maxTexCoordStreams,
                    " TEXCOORD streams are supported."
                });
            }
            if (renderMode == RendererModuleUI.RenderMode.Mesh)
            {
                ParticleSystemRenderer component = this.m_ParticleSystemUI.m_ParticleSystem.GetComponent <ParticleSystemRenderer>();
                Mesh[] array  = new Mesh[4];
                int    meshes = component.GetMeshes(array);
                for (int l = 0; l < meshes; l++)
                {
                    if (array[l].HasChannel(Mesh.InternalShaderChannel.TexCoord2))
                    {
                        if (text2 != "")
                        {
                            text2 += "\n\n";
                        }
                        text2 += "Meshes may only use a maximum of 2 input UV streams.";
                    }
                }
            }
            if (text2 != "")
            {
                GUIContent gUIContent = EditorGUIUtility.TextContent(text2);
                EditorGUILayout.HelpBox(gUIContent.text, MessageType.Error, true);
            }
        }
Exemplo n.º 3
0
 public void EnableVertexStreams(ParticleSystemVertexStreams streams)
 {
     this.Internal_SetVertexStreams(streams, true);
 }
        internal ParticleSystemVertexStreams Internal_GetEnabledVertexStreams(ParticleSystemVertexStreams streams)
        {
            List <ParticleSystemVertexStream> streamList = new List <ParticleSystemVertexStream>(activeVertexStreamsCount);

            GetActiveVertexStreams(streamList);

            ParticleSystemVertexStreams deprecatedStreams = 0;

            if (streamList.Contains(ParticleSystemVertexStream.Position))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.Position;
            }
            if (streamList.Contains(ParticleSystemVertexStream.Normal))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.Normal;
            }
            if (streamList.Contains(ParticleSystemVertexStream.Tangent))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.Tangent;
            }
            if (streamList.Contains(ParticleSystemVertexStream.Color))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.Color;
            }
            if (streamList.Contains(ParticleSystemVertexStream.UV))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.UV;
            }
            if (streamList.Contains(ParticleSystemVertexStream.UV2))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.UV2BlendAndFrame;
            }
            if (streamList.Contains(ParticleSystemVertexStream.Center))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.CenterAndVertexID;
            }
            if (streamList.Contains(ParticleSystemVertexStream.SizeXYZ))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.Size;
            }
            if (streamList.Contains(ParticleSystemVertexStream.Rotation3D))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.Rotation;
            }
            if (streamList.Contains(ParticleSystemVertexStream.Velocity))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.Velocity;
            }
            if (streamList.Contains(ParticleSystemVertexStream.AgePercent))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.Lifetime;
            }
            if (streamList.Contains(ParticleSystemVertexStream.Custom1XYZW))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.Custom1;
            }
            if (streamList.Contains(ParticleSystemVertexStream.Custom2XYZW))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.Custom2;
            }
            if (streamList.Contains(ParticleSystemVertexStream.StableRandomXYZ))
            {
                deprecatedStreams |= ParticleSystemVertexStreams.Random;
            }

            return(deprecatedStreams & streams);
        }
        internal void Internal_SetVertexStreams(ParticleSystemVertexStreams streams, bool enabled)
        {
            List <ParticleSystemVertexStream> streamList = new List <ParticleSystemVertexStream>(activeVertexStreamsCount);

            GetActiveVertexStreams(streamList);

            if (enabled)
            {
                if ((streams & ParticleSystemVertexStreams.Position) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.Position))
                    {
                        streamList.Add(ParticleSystemVertexStream.Position);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.Normal) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.Normal))
                    {
                        streamList.Add(ParticleSystemVertexStream.Normal);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.Tangent) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.Tangent))
                    {
                        streamList.Add(ParticleSystemVertexStream.Tangent);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.Color) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.Color))
                    {
                        streamList.Add(ParticleSystemVertexStream.Color);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.UV) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.UV))
                    {
                        streamList.Add(ParticleSystemVertexStream.UV);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.UV2BlendAndFrame) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.UV2))
                    {
                        streamList.Add(ParticleSystemVertexStream.UV2); streamList.Add(ParticleSystemVertexStream.AnimBlend); streamList.Add(ParticleSystemVertexStream.AnimFrame);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.CenterAndVertexID) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.Center))
                    {
                        streamList.Add(ParticleSystemVertexStream.Center); streamList.Add(ParticleSystemVertexStream.VertexID);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.Size) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.SizeXYZ))
                    {
                        streamList.Add(ParticleSystemVertexStream.SizeXYZ);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.Rotation) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.Rotation3D))
                    {
                        streamList.Add(ParticleSystemVertexStream.Rotation3D);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.Velocity) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.Velocity))
                    {
                        streamList.Add(ParticleSystemVertexStream.Velocity);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.Lifetime) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.AgePercent))
                    {
                        streamList.Add(ParticleSystemVertexStream.AgePercent); streamList.Add(ParticleSystemVertexStream.InvStartLifetime);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.Custom1) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.Custom1XYZW))
                    {
                        streamList.Add(ParticleSystemVertexStream.Custom1XYZW);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.Custom2) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.Custom2XYZW))
                    {
                        streamList.Add(ParticleSystemVertexStream.Custom2XYZW);
                    }
                }
                if ((streams & ParticleSystemVertexStreams.Random) != 0)
                {
                    if (!streamList.Contains(ParticleSystemVertexStream.StableRandomXYZ))
                    {
                        streamList.Add(ParticleSystemVertexStream.StableRandomXYZ); streamList.Add(ParticleSystemVertexStream.VaryingRandomX);
                    }
                }
            }
            else
            {
                if ((streams & ParticleSystemVertexStreams.Position) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.Position);
                }
                if ((streams & ParticleSystemVertexStreams.Normal) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.Normal);
                }
                if ((streams & ParticleSystemVertexStreams.Tangent) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.Tangent);
                }
                if ((streams & ParticleSystemVertexStreams.Color) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.Color);
                }
                if ((streams & ParticleSystemVertexStreams.UV) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.UV);
                }
                if ((streams & ParticleSystemVertexStreams.UV2BlendAndFrame) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.UV2); streamList.Remove(ParticleSystemVertexStream.AnimBlend); streamList.Remove(ParticleSystemVertexStream.AnimFrame);
                }
                if ((streams & ParticleSystemVertexStreams.CenterAndVertexID) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.Center); streamList.Remove(ParticleSystemVertexStream.VertexID);
                }
                if ((streams & ParticleSystemVertexStreams.Size) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.SizeXYZ);
                }
                if ((streams & ParticleSystemVertexStreams.Rotation) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.Rotation3D);
                }
                if ((streams & ParticleSystemVertexStreams.Velocity) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.Velocity);
                }
                if ((streams & ParticleSystemVertexStreams.Lifetime) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.AgePercent); streamList.Remove(ParticleSystemVertexStream.InvStartLifetime);
                }
                if ((streams & ParticleSystemVertexStreams.Custom1) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.Custom1XYZW);
                }
                if ((streams & ParticleSystemVertexStreams.Custom2) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.Custom2XYZW);
                }
                if ((streams & ParticleSystemVertexStreams.Random) != 0)
                {
                    streamList.Remove(ParticleSystemVertexStream.StableRandomXYZW); streamList.Remove(ParticleSystemVertexStream.VaryingRandomX);
                }
            }

            SetActiveVertexStreams(streamList);
        }
Exemplo n.º 6
0
        internal void Internal_SetVertexStreams(ParticleSystemVertexStreams streams, bool enabled)
        {
            List <ParticleSystemVertexStream> list = new List <ParticleSystemVertexStream>(this.activeVertexStreamsCount);

            this.GetActiveVertexStreams(list);
            if (enabled)
            {
                bool flag = (streams & ParticleSystemVertexStreams.Position) > ParticleSystemVertexStreams.None;
                if (flag)
                {
                    bool flag2 = !list.Contains(ParticleSystemVertexStream.Position);
                    if (flag2)
                    {
                        list.Add(ParticleSystemVertexStream.Position);
                    }
                }
                bool flag3 = (streams & ParticleSystemVertexStreams.Normal) > ParticleSystemVertexStreams.None;
                if (flag3)
                {
                    bool flag4 = !list.Contains(ParticleSystemVertexStream.Normal);
                    if (flag4)
                    {
                        list.Add(ParticleSystemVertexStream.Normal);
                    }
                }
                bool flag5 = (streams & ParticleSystemVertexStreams.Tangent) > ParticleSystemVertexStreams.None;
                if (flag5)
                {
                    bool flag6 = !list.Contains(ParticleSystemVertexStream.Tangent);
                    if (flag6)
                    {
                        list.Add(ParticleSystemVertexStream.Tangent);
                    }
                }
                bool flag7 = (streams & ParticleSystemVertexStreams.Color) > ParticleSystemVertexStreams.None;
                if (flag7)
                {
                    bool flag8 = !list.Contains(ParticleSystemVertexStream.Color);
                    if (flag8)
                    {
                        list.Add(ParticleSystemVertexStream.Color);
                    }
                }
                bool flag9 = (streams & ParticleSystemVertexStreams.UV) > ParticleSystemVertexStreams.None;
                if (flag9)
                {
                    bool flag10 = !list.Contains(ParticleSystemVertexStream.UV);
                    if (flag10)
                    {
                        list.Add(ParticleSystemVertexStream.UV);
                    }
                }
                bool flag11 = (streams & ParticleSystemVertexStreams.UV2BlendAndFrame) > ParticleSystemVertexStreams.None;
                if (flag11)
                {
                    bool flag12 = !list.Contains(ParticleSystemVertexStream.UV2);
                    if (flag12)
                    {
                        list.Add(ParticleSystemVertexStream.UV2);
                        list.Add(ParticleSystemVertexStream.AnimBlend);
                        list.Add(ParticleSystemVertexStream.AnimFrame);
                    }
                }
                bool flag13 = (streams & ParticleSystemVertexStreams.CenterAndVertexID) > ParticleSystemVertexStreams.None;
                if (flag13)
                {
                    bool flag14 = !list.Contains(ParticleSystemVertexStream.Center);
                    if (flag14)
                    {
                        list.Add(ParticleSystemVertexStream.Center);
                        list.Add(ParticleSystemVertexStream.VertexID);
                    }
                }
                bool flag15 = (streams & ParticleSystemVertexStreams.Size) > ParticleSystemVertexStreams.None;
                if (flag15)
                {
                    bool flag16 = !list.Contains(ParticleSystemVertexStream.SizeXYZ);
                    if (flag16)
                    {
                        list.Add(ParticleSystemVertexStream.SizeXYZ);
                    }
                }
                bool flag17 = (streams & ParticleSystemVertexStreams.Rotation) > ParticleSystemVertexStreams.None;
                if (flag17)
                {
                    bool flag18 = !list.Contains(ParticleSystemVertexStream.Rotation3D);
                    if (flag18)
                    {
                        list.Add(ParticleSystemVertexStream.Rotation3D);
                    }
                }
                bool flag19 = (streams & ParticleSystemVertexStreams.Velocity) > ParticleSystemVertexStreams.None;
                if (flag19)
                {
                    bool flag20 = !list.Contains(ParticleSystemVertexStream.Velocity);
                    if (flag20)
                    {
                        list.Add(ParticleSystemVertexStream.Velocity);
                    }
                }
                bool flag21 = (streams & ParticleSystemVertexStreams.Lifetime) > ParticleSystemVertexStreams.None;
                if (flag21)
                {
                    bool flag22 = !list.Contains(ParticleSystemVertexStream.AgePercent);
                    if (flag22)
                    {
                        list.Add(ParticleSystemVertexStream.AgePercent);
                        list.Add(ParticleSystemVertexStream.InvStartLifetime);
                    }
                }
                bool flag23 = (streams & ParticleSystemVertexStreams.Custom1) > ParticleSystemVertexStreams.None;
                if (flag23)
                {
                    bool flag24 = !list.Contains(ParticleSystemVertexStream.Custom1XYZW);
                    if (flag24)
                    {
                        list.Add(ParticleSystemVertexStream.Custom1XYZW);
                    }
                }
                bool flag25 = (streams & ParticleSystemVertexStreams.Custom2) > ParticleSystemVertexStreams.None;
                if (flag25)
                {
                    bool flag26 = !list.Contains(ParticleSystemVertexStream.Custom2XYZW);
                    if (flag26)
                    {
                        list.Add(ParticleSystemVertexStream.Custom2XYZW);
                    }
                }
                bool flag27 = (streams & ParticleSystemVertexStreams.Random) > ParticleSystemVertexStreams.None;
                if (flag27)
                {
                    bool flag28 = !list.Contains(ParticleSystemVertexStream.StableRandomXYZ);
                    if (flag28)
                    {
                        list.Add(ParticleSystemVertexStream.StableRandomXYZ);
                        list.Add(ParticleSystemVertexStream.VaryingRandomX);
                    }
                }
            }
            else
            {
                bool flag29 = (streams & ParticleSystemVertexStreams.Position) > ParticleSystemVertexStreams.None;
                if (flag29)
                {
                    list.Remove(ParticleSystemVertexStream.Position);
                }
                bool flag30 = (streams & ParticleSystemVertexStreams.Normal) > ParticleSystemVertexStreams.None;
                if (flag30)
                {
                    list.Remove(ParticleSystemVertexStream.Normal);
                }
                bool flag31 = (streams & ParticleSystemVertexStreams.Tangent) > ParticleSystemVertexStreams.None;
                if (flag31)
                {
                    list.Remove(ParticleSystemVertexStream.Tangent);
                }
                bool flag32 = (streams & ParticleSystemVertexStreams.Color) > ParticleSystemVertexStreams.None;
                if (flag32)
                {
                    list.Remove(ParticleSystemVertexStream.Color);
                }
                bool flag33 = (streams & ParticleSystemVertexStreams.UV) > ParticleSystemVertexStreams.None;
                if (flag33)
                {
                    list.Remove(ParticleSystemVertexStream.UV);
                }
                bool flag34 = (streams & ParticleSystemVertexStreams.UV2BlendAndFrame) > ParticleSystemVertexStreams.None;
                if (flag34)
                {
                    list.Remove(ParticleSystemVertexStream.UV2);
                    list.Remove(ParticleSystemVertexStream.AnimBlend);
                    list.Remove(ParticleSystemVertexStream.AnimFrame);
                }
                bool flag35 = (streams & ParticleSystemVertexStreams.CenterAndVertexID) > ParticleSystemVertexStreams.None;
                if (flag35)
                {
                    list.Remove(ParticleSystemVertexStream.Center);
                    list.Remove(ParticleSystemVertexStream.VertexID);
                }
                bool flag36 = (streams & ParticleSystemVertexStreams.Size) > ParticleSystemVertexStreams.None;
                if (flag36)
                {
                    list.Remove(ParticleSystemVertexStream.SizeXYZ);
                }
                bool flag37 = (streams & ParticleSystemVertexStreams.Rotation) > ParticleSystemVertexStreams.None;
                if (flag37)
                {
                    list.Remove(ParticleSystemVertexStream.Rotation3D);
                }
                bool flag38 = (streams & ParticleSystemVertexStreams.Velocity) > ParticleSystemVertexStreams.None;
                if (flag38)
                {
                    list.Remove(ParticleSystemVertexStream.Velocity);
                }
                bool flag39 = (streams & ParticleSystemVertexStreams.Lifetime) > ParticleSystemVertexStreams.None;
                if (flag39)
                {
                    list.Remove(ParticleSystemVertexStream.AgePercent);
                    list.Remove(ParticleSystemVertexStream.InvStartLifetime);
                }
                bool flag40 = (streams & ParticleSystemVertexStreams.Custom1) > ParticleSystemVertexStreams.None;
                if (flag40)
                {
                    list.Remove(ParticleSystemVertexStream.Custom1XYZW);
                }
                bool flag41 = (streams & ParticleSystemVertexStreams.Custom2) > ParticleSystemVertexStreams.None;
                if (flag41)
                {
                    list.Remove(ParticleSystemVertexStream.Custom2XYZW);
                }
                bool flag42 = (streams & ParticleSystemVertexStreams.Random) > ParticleSystemVertexStreams.None;
                if (flag42)
                {
                    list.Remove(ParticleSystemVertexStream.StableRandomXYZW);
                    list.Remove(ParticleSystemVertexStream.VaryingRandomX);
                }
            }
            this.SetActiveVertexStreams(list);
        }
 /// <summary>
 /// <para>Disable a set of vertex shader streams on the particle system renderer.
 /// The position stream is always enabled, and any attempts to remove it will be ignored.</para>
 /// </summary>
 /// <param name="streams">Streams to disable.</param>
 public void DisableVertexStreams(ParticleSystemVertexStreams streams)
 {
     this.Internal_SetVertexStreams(streams, false);
 }
Exemplo n.º 8
0
 public void DisableVertexStreams(ParticleSystemVertexStreams streams)
 {
     Internal_SetVertexStreams(streams, enabled: false);
 }
Exemplo n.º 9
0
 /// <summary>
 /// <para>Query whether the particle system renderer uses a particular set of vertex streams.</para>
 /// </summary>
 /// <param name="streams">Streams to query.</param>
 /// <returns>
 /// <para>Returns the subset of the queried streams that are actually enabled.</para>
 /// </returns>
 public ParticleSystemVertexStreams GetEnabledVertexStreams(ParticleSystemVertexStreams streams) =>
 this.Internal_GetEnabledVertexStreams(streams);
 private extern void Internal_SetVertexStreams(ParticleSystemVertexStreams streams, bool enabled);
Exemplo n.º 11
0
 public void EnableVertexStreams(ParticleSystemVertexStreams streams)
 {
     Internal_SetVertexStreams(streams, enabled: true);
 }
 private extern ParticleSystemVertexStreams Internal_GetEnabledVertexStreams(ParticleSystemVertexStreams streams);
 /// <summary>
 /// <para>Query whether the particle system renderer uses a particular set of vertex streams.</para>
 /// </summary>
 /// <param name="streams">Streams to query.</param>
 /// <returns>
 /// <para>Returns the subset of the queried streams that are actually enabled.</para>
 /// </returns>
 public ParticleSystemVertexStreams GetEnabledVertexStreams(ParticleSystemVertexStreams streams)
 {
     return this.Internal_GetEnabledVertexStreams(streams);
 }
 /// <summary>
 /// <para>Enable a set of vertex shader streams on the particle system renderer.</para>
 /// </summary>
 /// <param name="streams">Streams to enable.</param>
 public void EnableVertexStreams(ParticleSystemVertexStreams streams)
 {
     this.Internal_SetVertexStreams(streams, true);
 }
Exemplo n.º 15
0
 public bool AreVertexStreamsEnabled(ParticleSystemVertexStreams streams)
 {
     return(this.Internal_GetEnabledVertexStreams(streams) == streams);
 }
Exemplo n.º 16
0
 private extern ParticleSystemVertexStreams Internal_GetEnabledVertexStreams(ParticleSystemVertexStreams streams);
Exemplo n.º 17
0
 public ParticleSystemVertexStreams GetEnabledVertexStreams(ParticleSystemVertexStreams streams)
 {
     return(this.Internal_GetEnabledVertexStreams(streams));
 }
Exemplo n.º 18
0
 private extern void Internal_SetVertexStreams(ParticleSystemVertexStreams streams, bool enabled);
Exemplo n.º 19
0
        internal ParticleSystemVertexStreams Internal_GetEnabledVertexStreams(ParticleSystemVertexStreams streams)
        {
            List <ParticleSystemVertexStream> list = new List <ParticleSystemVertexStream>(this.activeVertexStreamsCount);

            this.GetActiveVertexStreams(list);
            ParticleSystemVertexStreams particleSystemVertexStreams = ParticleSystemVertexStreams.None;
            bool flag = list.Contains(ParticleSystemVertexStream.Position);

            if (flag)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.Position;
            }
            bool flag2 = list.Contains(ParticleSystemVertexStream.Normal);

            if (flag2)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.Normal;
            }
            bool flag3 = list.Contains(ParticleSystemVertexStream.Tangent);

            if (flag3)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.Tangent;
            }
            bool flag4 = list.Contains(ParticleSystemVertexStream.Color);

            if (flag4)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.Color;
            }
            bool flag5 = list.Contains(ParticleSystemVertexStream.UV);

            if (flag5)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.UV;
            }
            bool flag6 = list.Contains(ParticleSystemVertexStream.UV2);

            if (flag6)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.UV2BlendAndFrame;
            }
            bool flag7 = list.Contains(ParticleSystemVertexStream.Center);

            if (flag7)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.CenterAndVertexID;
            }
            bool flag8 = list.Contains(ParticleSystemVertexStream.SizeXYZ);

            if (flag8)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.Size;
            }
            bool flag9 = list.Contains(ParticleSystemVertexStream.Rotation3D);

            if (flag9)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.Rotation;
            }
            bool flag10 = list.Contains(ParticleSystemVertexStream.Velocity);

            if (flag10)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.Velocity;
            }
            bool flag11 = list.Contains(ParticleSystemVertexStream.AgePercent);

            if (flag11)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.Lifetime;
            }
            bool flag12 = list.Contains(ParticleSystemVertexStream.Custom1XYZW);

            if (flag12)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.Custom1;
            }
            bool flag13 = list.Contains(ParticleSystemVertexStream.Custom2XYZW);

            if (flag13)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.Custom2;
            }
            bool flag14 = list.Contains(ParticleSystemVertexStream.StableRandomXYZ);

            if (flag14)
            {
                particleSystemVertexStreams |= ParticleSystemVertexStreams.Random;
            }
            return(particleSystemVertexStreams & streams);
        }
 /// <summary>
 /// <para>Query whether the particle system renderer uses a particular set of vertex streams.</para>
 /// </summary>
 /// <param name="streams">Streams to query.</param>
 /// <returns>
 /// <para>Whether all the queried streams are enabled or not.</para>
 /// </returns>
 public bool AreVertexStreamsEnabled(ParticleSystemVertexStreams streams)
 {
     return (this.Internal_GetEnabledVertexStreams(streams) == streams);
 }