init: version 1
This commit is contained in:
14
Assets/Prefabs/Walls/Scripts/CubeWallController.cs
Normal file
14
Assets/Prefabs/Walls/Scripts/CubeWallController.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using UnityEngine;
|
||||
|
||||
[RequireComponent(typeof(SpriteRenderer), typeof(Collider2D), typeof(Animator))]
|
||||
public class CubeWallController : WallController
|
||||
{
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
if (other.CompareTag("Cube"))
|
||||
{
|
||||
CubeController cube = other.GetComponent<CubeController>();
|
||||
cube.Respawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user