本文整理汇总了C#中ParticleSystem.SetParameter方法的典型用法代码示例。如果您正苦于以下问题:C# ParticleSystem.SetParameter方法的具体用法?C# ParticleSystem.SetParameter怎么用?C# ParticleSystem.SetParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleSystem
的用法示例。
在下文中一共展示了ParticleSystem.SetParameter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseAttrib
/// <summary>
/// Parses an attribute intended for the particle system itself.
/// </summary>
/// <param name="line"></param>
/// <param name="system"></param>
private void ParseAttrib(string line, ParticleSystem system)
{
// Split params on space or tab
char []delims = {'\t', ' '};
string[] values = line.Split(delims, 2);
// Look up first param (command setting)
if (!system.SetParameter(values[0], values[1]))
{
// Attribute not supported by particle system, try the renderer
ParticleSystemRenderer renderer = system.Renderer;
if (renderer != null)
{
if (!renderer.SetParameter(values[0], values[1]))
{
log.WarnFormat("Bad particle system attribute line: '{0}' in {1} (tried renderer)",
line, system.Name);
}
}
else
{
// BAD command. BAD!
log.WarnFormat("Bad particle system attribute line: '{0}' in {1} (no renderer)",
line, system.Name);
}
}
}
示例2: ParseAttrib
/// <summary>
/// Parses an attribute intended for the particle system itself.
/// </summary>
/// <param name="line"></param>
/// <param name="system"></param>
private void ParseAttrib( string line, ParticleSystem system )
{
// Split params on space or tab
char[] delims = {
'\t', ' '
};
var values = StringConverter.Split( line, delims, 2 );
// Look up first param (command setting)
if ( !system.SetParameter( values[ 0 ], values[ 1 ] ) )
{
// Attribute not supported by particle system, try the renderer
var renderer = system.Renderer;
if ( renderer != null )
{
if ( !renderer.SetParameter( values[ 0 ], values[ 1 ] ) )
{
LogManager.Instance.Write( "Bad particle system attribute line: '{0}' in {1} (tried renderer)", line, system.Name );
}
}
else
{
// BAD command. BAD!
LogManager.Instance.Write( "Bad particle system attribute line: '{0}' in {1} (no renderer)", line, system.Name );
}
}
}