Browse Source

Implemented lava splash particle effect. Also made particles a bit larger across the board. This probably aren't the correct size values yet, but they do make the particles stand out better.

readme
Nico de Poel 5 years ago
parent
commit
e321160e45
  1. 3
      Assets/Scripts/Modules/GameModule.cs
  2. 36
      Assets/Scripts/VisualStyle.cs
  3. 2
      Assets/Styles/GLQuake/GLQuake.asset
  4. 4864
      Assets/Styles/GLQuake/Particles/LavaSplash.prefab
  5. 7
      Assets/Styles/GLQuake/Particles/LavaSplash.prefab.meta
  6. 2
      Assets/Styles/GLQuake/Particles/ParticleEffect.prefab
  7. 4
      Assets/Styles/GLQuake/Particles/ParticleExplosion.prefab
  8. 2
      Assets/Styles/GLQuake/Particles/TeleportSplash.prefab
  9. 2
      engine/Quake/r_part.c
  10. 1
      engine/Quake/render.h
  11. 5
      engine/UniQuake/game_uniquake.c

3
Assets/Scripts/Modules/GameModule.cs

@ -83,6 +83,9 @@ public partial class GameModule
case ParticleEffect.TeleportSplash: case ParticleEffect.TeleportSplash:
uq.CurrentStyle.Particles.CreateTeleportSplash(position, uq.GameLayer); uq.CurrentStyle.Particles.CreateTeleportSplash(position, uq.GameLayer);
break; break;
case ParticleEffect.LavaSplash:
uq.CurrentStyle.Particles.CreateLavaSplash(position, uq.GameLayer);
break;
} }
} }

36
Assets/Scripts/VisualStyle.cs

@ -161,15 +161,15 @@ public class ParticleSystems
[SerializeField] [SerializeField]
protected ParticleSystem teleportSplash; protected ParticleSystem teleportSplash;
[SerializeField]
protected ParticleSystem lavaSplash;
public virtual void RunParticleEffect(Vector3 position, Vector3 direction, Color colorMin, Color colorMax, int count, Layers layer) public virtual void RunParticleEffect(Vector3 position, Vector3 direction, Color colorMin, Color colorMax, int count, Layers layer)
{ {
if (particleEffect == null)
var effect = InstantiateEffect(particleEffect, position, layer);
if (effect == null)
return; return;
var effect = Object.Instantiate(particleEffect);
SetLayer(effect.gameObject, layer);
effect.transform.position = position;
var main = effect.main; var main = effect.main;
main.maxParticles = count; main.maxParticles = count;
@ -189,24 +189,30 @@ public class ParticleSystems
public virtual void CreateExplosion(Vector3 position, Layers layer) public virtual void CreateExplosion(Vector3 position, Layers layer)
{ {
if (explosion == null)
return;
var effect = Object.Instantiate(explosion);
SetLayer(effect.gameObject, layer);
effect.transform.position = position;
InstantiateEffect(explosion, position, layer);
} }
public virtual void CreateTeleportSplash(Vector3 position, Layers layer) public virtual void CreateTeleportSplash(Vector3 position, Layers layer)
{ {
if (teleportSplash == null)
return;
InstantiateEffect(teleportSplash, position, layer);
}
public virtual void CreateLavaSplash(Vector3 position, Layers layer)
{
InstantiateEffect(lavaSplash, position, layer);
}
var effect = Object.Instantiate(teleportSplash);
protected virtual ParticleSystem InstantiateEffect(ParticleSystem template, Vector3 position, Layers layer)
{
if (template == null)
return null;
var effect = Object.Instantiate(template);
SetLayer(effect.gameObject, layer); SetLayer(effect.gameObject, layer);
effect.transform.position = position; effect.transform.position = position;
return effect;
} }
protected static void SetLayer(GameObject go, Layers layer) protected static void SetLayer(GameObject go, Layers layer)
{ {
go.layer = (int)layer; go.layer = (int)layer;

2
Assets/Styles/GLQuake/GLQuake.asset

@ -29,3 +29,5 @@ MonoBehaviour:
type: 3} type: 3}
teleportSplash: {fileID: 9150008102338277659, guid: 79bef89ba1457cb42a9fbeaf4acff66f, teleportSplash: {fileID: 9150008102338277659, guid: 79bef89ba1457cb42a9fbeaf4acff66f,
type: 3} type: 3}
lavaSplash: {fileID: 9150008102338277659, guid: 4db0c926dce46fe4c90920ecd8c5df2e,
type: 3}

4864
Assets/Styles/GLQuake/Particles/LavaSplash.prefab
File diff suppressed because it is too large
View File

7
Assets/Styles/GLQuake/Particles/LavaSplash.prefab.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4db0c926dce46fe4c90920ecd8c5df2e
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

2
Assets/Styles/GLQuake/Particles/ParticleEffect.prefab

@ -284,7 +284,7 @@ ParticleSystem:
startSize: startSize:
serializedVersion: 2 serializedVersion: 2
minMaxState: 0 minMaxState: 0
scalar: 1.27
scalar: 2
minScalar: 1 minScalar: 1
maxCurve: maxCurve:
serializedVersion: 2 serializedVersion: 2

4
Assets/Styles/GLQuake/Particles/ParticleExplosion.prefab

@ -285,7 +285,7 @@ ParticleSystem:
startSize: startSize:
serializedVersion: 2 serializedVersion: 2
minMaxState: 0 minMaxState: 0
scalar: 1.27
scalar: 2
minScalar: 1 minScalar: 1
maxCurve: maxCurve:
serializedVersion: 2 serializedVersion: 2
@ -5147,7 +5147,7 @@ ParticleSystem:
startSize: startSize:
serializedVersion: 2 serializedVersion: 2
minMaxState: 0 minMaxState: 0
scalar: 1.27
scalar: 2
minScalar: 1 minScalar: 1
maxCurve: maxCurve:
serializedVersion: 2 serializedVersion: 2

2
Assets/Styles/GLQuake/Particles/TeleportSplash.prefab

@ -284,7 +284,7 @@ ParticleSystem:
startSize: startSize:
serializedVersion: 2 serializedVersion: 2
minMaxState: 0 minMaxState: 0
scalar: 1.27
scalar: 2
minScalar: 1 minScalar: 1
maxCurve: maxCurve:
serializedVersion: 2 serializedVersion: 2

2
engine/Quake/r_part.c

@ -567,6 +567,8 @@ void R_LavaSplash (vec3_t org)
vel = 50 + (rand()&63); vel = 50 + (rand()&63);
VectorScale (dir, vel, p->vel); VectorScale (dir, vel, p->vel);
} }
UQ_Game_LavaSplash(org);
} }
/* /*

1
engine/Quake/render.h

@ -181,5 +181,6 @@ void UQ_GL_SetupView(vec3_t origin, vec3_t angles, mleaf_t *viewLeaf);
void UQ_Game_RunParticleEffect(vec3_t origin, vec3_t direction, int color, int count); void UQ_Game_RunParticleEffect(vec3_t origin, vec3_t direction, int color, int count);
void UQ_Game_ParticleExplosion(vec3_t origin); void UQ_Game_ParticleExplosion(vec3_t origin);
void UQ_Game_TeleportSplash(vec3_t origin); void UQ_Game_TeleportSplash(vec3_t origin);
void UQ_Game_LavaSplash(vec3_t origin);
#endif /* _QUAKE_RENDER_H */ #endif /* _QUAKE_RENDER_H */

5
engine/UniQuake/game_uniquake.c

@ -74,3 +74,8 @@ void UQ_Game_TeleportSplash(vec3_t origin)
{ {
unity_gamecalls->CreateParticleEffect(unity_context, PARTFX_TELEPORT_SPLASH, origin, 0, 0); unity_gamecalls->CreateParticleEffect(unity_context, PARTFX_TELEPORT_SPLASH, origin, 0, 0);
} }
void UQ_Game_LavaSplash(vec3_t origin)
{
unity_gamecalls->CreateParticleEffect(unity_context, PARTFX_LAVA_SPLASH, origin, 0, 0);
}
Loading…
Cancel
Save