Untitled
unknown
csharp
a year ago
669 B
8
Indexable
using UnityEngine;
public class DashPanel : MonoBehaviour
{
[SerializeField] private float dashSpeed = 50f;
[SerializeField] private float dashDuration = 1f;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
MoveAction moveAction = other.GetComponent<MoveAction>();
PlayerPhysics playerPhysics = other.GetComponent<PlayerPhysics>();
if (moveAction != null && playerPhysics != null && playerPhysics.groundInfo.ground)
{
moveAction.TriggerDash(dashSpeed, dashDuration, transform.forward);
}
}
}
}
Editor is loading...
Leave a Comment