public override void OnUpdate() { Vector3 leadPos = particlesManagement.GetParticlePosition(0); particleEffect.SetParameterValue("Fireworks_Tail", "Position", leadPos); particleEffect.SetParameterValue("Fireworks_Sphere", "Position", leadPos); particleEffect.SetParameterValue("Fireworks_Inner", "Position", leadPos); }
public override void OnUpdate() { if (Input.GetAction("Space")) { Actor spawn = PrefabManager.SpawnPrefab(FireworkPrefab, Camera.MainCamera.Position); ParticleEffect fireworkFX = spawn.As <ParticleEffect>(); Color selectedColor = Colors[random.Next(0, Colors.Length)]; fireworkFX.SetParameterValue("Fireworks_Sphere", "Fireworks Color", selectedColor); fireworkFX.SetParameterValue("Fireworks_Inner", "Fireworks Color", selectedColor); Destroy(spawn, 12); } }