implemented skill system according to designdocuments
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NightclubArcadia.Skills
|
||||
{
|
||||
[RequireComponent(typeof(Collider))]
|
||||
public sealed class CommentaryTrigger : MonoBehaviour
|
||||
{
|
||||
[SerializeField] string contextId;
|
||||
[SerializeField] bool repeatable;
|
||||
[SerializeField] string playerTag = "Player";
|
||||
|
||||
void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (string.IsNullOrEmpty(contextId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(playerTag) && !other.CompareTag(playerTag))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var runtime = SkillRuntime.Instance;
|
||||
if (runtime == null || runtime.Commentary == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
runtime.Commentary.RequestCommentary(contextId, repeatable);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user