当前位置: 首页>>代码示例>>C#>>正文


C# ISceneChildEntity.AddNewParticleSystem方法代码示例

本文整理汇总了C#中ISceneChildEntity.AddNewParticleSystem方法的典型用法代码示例。如果您正苦于以下问题:C# ISceneChildEntity.AddNewParticleSystem方法的具体用法?C# ISceneChildEntity.AddNewParticleSystem怎么用?C# ISceneChildEntity.AddNewParticleSystem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISceneChildEntity的用法示例。


在下文中一共展示了ISceneChildEntity.AddNewParticleSystem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetParticleSystem


//.........这里部分代码省略.........
                    // PSYS_SRC_INNERANGLE and PSYS_SRC_ANGLE_BEGIN use the same variables. The
                    // PSYS_SRC_OUTERANGLE and PSYS_SRC_ANGLE_END also use the same variable. The
                    // client tells the difference between the two by looking at the 0x02 bit in
                    // the PartFlags variable.
                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_INNERANGLE)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.InnerAngle = (float)tempf;
                        prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.OuterAngle = (float)tempf;
                        prules.PartFlags &= 0xFFFFFFFD; // Make sure new angle format is off.
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_TEXTURE)
                    {
                        prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1));
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_RATE)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.BurstRate = (float)tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_PART_COUNT)
                    {
                        prules.BurstPartCount = (byte)(int)rules.GetLSLIntegerItem(i + 1);
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_RADIUS)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.BurstRadius = (float)tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MIN)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.BurstSpeedMin = (float)tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_BURST_SPEED_MAX)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.BurstSpeedMax = (float)tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_MAX_AGE)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.MaxAge = (float)tempf;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_TARGET_KEY)
                    {
                        UUID key = UUID.Zero;
                        if (UUID.TryParse(rules.Data[i + 1].ToString(), out key))
                        {
                            prules.Target = key;
                        }
                        else
                        {
                            prules.Target = part.UUID;
                        }
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_OMEGA)
                    {
                        // AL: This is an assumption, since it is the only thing that would match.
                        tempv = rules.GetVector3Item(i + 1);
                        prules.AngularVelocity.X = (float)tempv.x;
                        prules.AngularVelocity.Y = (float)tempv.y;
                        prules.AngularVelocity.Z = (float)tempv.z;
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.InnerAngle = (float)tempf;
                        prules.PartFlags |= 0x02; // Set new angle format.
                    }

                    else if (rule == (int)ScriptBaseClass.PSYS_SRC_ANGLE_END)
                    {
                        tempf = (float)rules.GetLSLFloatItem(i + 1);
                        prules.OuterAngle = (float)tempf;
                        prules.PartFlags |= 0x02; // Set new angle format.
                    }
                }
                prules.CRC = 1;

                part.AddNewParticleSystem(prules);
            }
            part.ScheduleUpdate(PrimUpdateFlags.Particles);
        }
开发者ID:rknop,项目名称:Aurora-Sim,代码行数:101,代码来源:LSL_Api.cs


注:本文中的ISceneChildEntity.AddNewParticleSystem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。