-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathParticleSystemComponent.cs
More file actions
49 lines (41 loc) · 1.64 KB
/
ParticleSystemComponent.cs
File metadata and controls
49 lines (41 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using Arch.Core;
using DCL.ECSComponents;
using ECS.StreamableLoading.Common;
using ECS.StreamableLoading.Textures;
using UnityEngine;
namespace DCL.SDKComponents.ParticleSystem
{
public struct ParticleSystemComponent
{
public readonly UnityEngine.ParticleSystem ParticleSystemInstance;
public readonly ParticleSystemRenderer Renderer;
public readonly GameObject HostGameObject;
public GetTextureIntention LoadingTextureIntention;
public AssetPromise<TextureData, GetTextureIntention>? TexturePromise;
public Material ParticleMaterial;
public uint LastRestartCount;
// Cached objects to avoid allocations on dirty updates
public Gradient CachedGradient;
public GradientColorKey[] CachedColorKeys;
public GradientAlphaKey[] CachedAlphaKeys;
public AnimationCurve CachedCurve;
// Blend mode tracking to skip redundant material operations
public PBParticleSystem.Types.BlendMode LastAppliedBlendMode;
public bool BlendModeInitialized;
public ParticleSystemComponent(UnityEngine.ParticleSystem instance, GameObject hostGameObject) : this()
{
ParticleSystemInstance = instance;
Renderer = instance.GetComponent<ParticleSystemRenderer>();
HostGameObject = hostGameObject;
}
public void CleanUpTexture(in World world)
{
LoadingTextureIntention = default(GetTextureIntention);
if (TexturePromise != null)
{
TexturePromise.Value.ForgetLoading(world);
TexturePromise = null;
}
}
}
}