本文整理汇总了C#中ParticlePlayground.PlaygroundParticlesC.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# PlaygroundParticlesC.GetComponent方法的具体用法?C# PlaygroundParticlesC.GetComponent怎么用?C# PlaygroundParticlesC.GetComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticlePlayground.PlaygroundParticlesC
的用法示例。
在下文中一共展示了PlaygroundParticlesC.GetComponent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetInitialTargetPosition
// Initial target position
public static void SetInitialTargetPosition(PlaygroundParticlesC playgroundParticles, Vector3 position, bool refreshParticleSystem)
{
for (int p = 0; p<playgroundParticles.particleCache.Length; p++) {
playgroundParticles.playgroundCache.previousTargetPosition[p] = position;
playgroundParticles.playgroundCache.targetPosition[p] = position;
playgroundParticles.particleCache[p].size = 0;
playgroundParticles.playgroundCache.position[p] = position;
}
if (refreshParticleSystem)
playgroundParticles.GetComponent<ParticleSystem>().SetParticles(playgroundParticles.particleCache, playgroundParticles.particleCache.Length);
}
示例2: SetInitialTargetPosition
// Initial target position
public static void SetInitialTargetPosition (PlaygroundParticlesC playgroundParticles, Vector3 position, bool refreshParticleSystem) {
for (int p = 0; p<playgroundParticles.particleCache.Length; p++) {
playgroundParticles.playgroundCache.previousTargetPosition[p] = position;
playgroundParticles.playgroundCache.targetPosition[p] = position;
#if UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
playgroundParticles.particleCache[p].size = 0;
#else
playgroundParticles.particleCache[p].startSize = 0;
#endif
playgroundParticles.particleCache[p].position = position;
playgroundParticles.playgroundCache.position[p] = position;
playgroundParticles.playgroundCache.collisionParticlePosition[p] = position;
}
if (refreshParticleSystem)
playgroundParticles.GetComponent<ParticleSystem>().SetParticles(playgroundParticles.particleCache, playgroundParticles.particleCache.Length);
}