public void Play(VfxType type, Vector3 pos = new Vector3(), Transform transform = null) { GameObject tmpPrefab = null; for (int i = 0; i < m_vfxs.Count; ++i) { if (type == m_vfxs[i].m_type) { tmpPrefab = m_vfxs[i].m_prefab; } } if (tmpPrefab) { GameObject vfx = Instantiate(tmpPrefab, transform); vfx.transform.position = pos; } }
/// <summary> /// Creates a visual beam effect. /// </summary> /// <param name="fxType">The beam effect to render.</param> /// <param name="emitter">The origin object of this beam .</param> /// <param name="origin">The origin body part of this beam.</param> /// <param name="missTarget">If true, the beam will hit a random position near or past the applied target to indicate a miss.</param> public static Effect Beam(VfxType fxType, NwGameObject emitter, BodyNode origin, bool missTarget = false) => NWScript.EffectBeam((int)fxType, emitter, (int)origin, missTarget.ToInt());
public static Effect VisualEffect(VfxType visualEffectId, bool missEffect = false) => NWScript.EffectVisualEffect((int)visualEffectId, missEffect.ToInt());
public static Effect SummonCreature(string creatureResRef, VfxType vfxType, TimeSpan delay = default, int appearType = 0) => NWScript.EffectSummonCreature(creatureResRef, (int)vfxType, (float)delay.TotalSeconds, appearType);
public static Effect VisualEffect(VfxType visualEffectId, bool missEffect = false, float fScale = 1.0f, System.Numerics.Vector3 vTranslate = default, System.Numerics.Vector3 vRotate = default) => NWScript.EffectVisualEffect((int)visualEffectId, missEffect.ToInt(), fScale, vTranslate, vRotate);