SHA256
Document Render Core And API
This commit is contained in:
22 files changed
+1241
-27
No files matched your search
@@ -4,10 +4,22 @@ using UnityEngine;
|
||||
|
||||
namespace ADOFAIRenderer.Util
|
||||
{
|
||||
/// <summary>Particle system helpers.</summary>
|
||||
internal static class ParticleUtil
|
||||
{
|
||||
/// <summary>
|
||||
/// Renderer found for each particle system. Weak keys: an entry is dropped when its ParticleSystem object is collected.
|
||||
/// Main thread.
|
||||
/// </summary>
|
||||
private static readonly ConditionalWeakTable<ParticleSystem, ParticleSystemRenderer> Cache = new();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the ParticleSystemRenderer that belongs to <paramref name="ps"/>. When a GameObject has several particle
|
||||
/// systems and renderers, the renderer with the same component index as the particle system is used; otherwise the
|
||||
/// first renderer of the GameObject. The result is cached per particle system. Main thread.
|
||||
/// </summary>
|
||||
/// <param name="ps">Particle system; null or destroyed returns null.</param>
|
||||
/// <returns>The renderer, or null when the GameObject has none.</returns>
|
||||
public static ParticleSystemRenderer? GetRenderer(this ParticleSystem ps)
|
||||
{
|
||||
if (!ps) return null;
|
||||
|
||||
Reference in new issue
Block a user