Import 2D Level
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Reflection;
|
||||
|
||||
[RequireComponent(typeof(ParticleSystem))]
|
||||
public class EmitParticlesOnLand : MonoBehaviour
|
||||
{
|
||||
|
||||
public bool emitOnLand = true;
|
||||
public bool emitOnEnemyDeath = true;
|
||||
|
||||
#if UNITY_TEMPLATE_PLATFORMER
|
||||
|
||||
ParticleSystem p;
|
||||
|
||||
void Start()
|
||||
{
|
||||
p = GetComponent<ParticleSystem>();
|
||||
|
||||
if (emitOnLand) {
|
||||
Platformer.Gameplay.PlayerLanded.OnExecute += PlayerLanded_OnExecute;
|
||||
void PlayerLanded_OnExecute(Platformer.Gameplay.PlayerLanded obj) {
|
||||
p.Play();
|
||||
}
|
||||
}
|
||||
|
||||
if (emitOnEnemyDeath) {
|
||||
Platformer.Gameplay.EnemyDeath.OnExecute += EnemyDeath_OnExecute;
|
||||
void EnemyDeath_OnExecute(Platformer.Gameplay.EnemyDeath obj) {
|
||||
p.Play();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user