From 4bf9ceba85c7424aef8bb82f53b405ddb450acf3 Mon Sep 17 00:00:00 2001 From: Ammar Askar Date: Thu, 3 Aug 2023 18:54:36 -0400 Subject: [PATCH] Add code to start rendering meta particle and models --- Assets/Scripts/OpenTS2/Content/DBPF/EffectsAsset.cs | 2 ++ Assets/Scripts/OpenTS2/Engine/Tests/EffectsTest.cs | 1 + Assets/Scripts/OpenTS2/Scenes/EffectsManager.cs | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/Assets/Scripts/OpenTS2/Content/DBPF/EffectsAsset.cs b/Assets/Scripts/OpenTS2/Content/DBPF/EffectsAsset.cs index 7edc7c2..49c001d 100644 --- a/Assets/Scripts/OpenTS2/Content/DBPF/EffectsAsset.cs +++ b/Assets/Scripts/OpenTS2/Content/DBPF/EffectsAsset.cs @@ -75,7 +75,9 @@ namespace OpenTS2.Content.DBPF return description.EffectType switch { 1 => ParticleEffects[description.EffectIndex], + 2 => MetaParticleEffects[description.EffectIndex], 6 => SequenceEffects[description.EffectIndex], + 10 => ModelEffects[description.EffectIndex], _ => throw new NotImplementedException( $"Block type {description.EffectType} in VisualEffect not supported") }; diff --git a/Assets/Scripts/OpenTS2/Engine/Tests/EffectsTest.cs b/Assets/Scripts/OpenTS2/Engine/Tests/EffectsTest.cs index 079b55a..2ae8071 100644 --- a/Assets/Scripts/OpenTS2/Engine/Tests/EffectsTest.cs +++ b/Assets/Scripts/OpenTS2/Engine/Tests/EffectsTest.cs @@ -17,5 +17,6 @@ public class EffectsTest : MonoBehaviour var effectsManager = GetComponent(); effectsManager.StartEffect("neighborhood_house_smoking"); + //effectsManager.StartEffect("neighborhood_hanggliders"); } } \ No newline at end of file diff --git a/Assets/Scripts/OpenTS2/Scenes/EffectsManager.cs b/Assets/Scripts/OpenTS2/Scenes/EffectsManager.cs index e76b42a..48fd6c3 100644 --- a/Assets/Scripts/OpenTS2/Scenes/EffectsManager.cs +++ b/Assets/Scripts/OpenTS2/Scenes/EffectsManager.cs @@ -62,6 +62,17 @@ namespace OpenTS2.Scenes var subSystem = CreateForParticleEffect(effectDescription, e); subSystem.transform.SetParent(unityParticleSystem.transform, worldPositionStays: false); break; + case MetaParticle e: + // TODO: apply adjustments from meta particle on the base particle effect. + StartEffect(e.BaseEffect); + break; + case ModelEffect e: + Debug.Log($"modeleffect mode name: {e.ModelName}"); + var model = ContentProvider.Get() + .GetAsset(new ResourceKey(e.ModelName, GroupIDs.Scenegraph, + TypeIDs.SCENEGRAPH_CRES)); + model.CreateRootGameObject(); + break; default: throw new NotImplementedException($"Effect type {effect} not supported"); }