Import 2D Level
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Platformer.Gameplay;
|
||||
using UnityEngine;
|
||||
using static Platformer.Core.Simulation;
|
||||
|
||||
namespace Platformer.Mechanics
|
||||
{
|
||||
/// <summary>
|
||||
/// DeathZone components mark a collider which will schedule a
|
||||
/// PlayerEnteredDeathZone event when the player enters the trigger.
|
||||
/// </summary>
|
||||
public class DeathZone : MonoBehaviour
|
||||
{
|
||||
void OnTriggerEnter2D(Collider2D collider)
|
||||
{
|
||||
var p = collider.gameObject.GetComponent<PlayerController>();
|
||||
if (p != null)
|
||||
{
|
||||
var ev = Schedule<PlayerEnteredDeathZone>();
|
||||
ev.deathzone = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user