Add code to start rendering meta particle and models

This commit is contained in:
Ammar Askar 2023-08-03 18:54:36 -04:00
parent 3ca271f7ec
commit 4bf9ceba85
3 changed files with 14 additions and 0 deletions

View file

@ -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")
};

View file

@ -17,5 +17,6 @@ public class EffectsTest : MonoBehaviour
var effectsManager = GetComponent<EffectsManager>();
effectsManager.StartEffect("neighborhood_house_smoking");
//effectsManager.StartEffect("neighborhood_hanggliders");
}
}

View file

@ -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<ScenegraphResourceAsset>(new ResourceKey(e.ModelName, GroupIDs.Scenegraph,
TypeIDs.SCENEGRAPH_CRES));
model.CreateRootGameObject();
break;
default:
throw new NotImplementedException($"Effect type {effect} not supported");
}