2026-02-01 11:12:05 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
public class GhostController : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
private PlayerMovement _playerMovement;
|
|
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
|
|
|
|
_playerMovement = GetComponent<PlayerMovement>();
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-02 00:48:51 +00:00
|
|
|
public void GhostRunInput(InputFrame inputFrame)
|
2026-02-01 11:12:05 +00:00
|
|
|
{
|
2026-02-02 00:48:51 +00:00
|
|
|
_playerMovement.SetMoveInput(new Vector2(inputFrame.moveX, 0));
|
|
|
|
|
if (inputFrame.isJumpPressed)
|
2026-02-01 11:12:05 +00:00
|
|
|
{
|
2026-02-02 00:48:51 +00:00
|
|
|
_playerMovement.TryJump();
|
2026-02-01 11:12:05 +00:00
|
|
|
}
|
|
|
|
|
|
2026-02-02 00:48:51 +00:00
|
|
|
if (inputFrame.isHangPressed)
|
2026-02-01 11:12:05 +00:00
|
|
|
{
|
2026-02-02 00:48:51 +00:00
|
|
|
_playerMovement.TryHang();
|
2026-02-01 11:12:05 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-02-02 00:48:51 +00:00
|
|
|
|
|
|
|
|
public void StopGhost()
|
|
|
|
|
{
|
|
|
|
|
GhostRunInput(new InputFrame(0f, false, false));
|
|
|
|
|
}
|
2026-02-01 11:12:05 +00:00
|
|
|
}
|
2026-02-02 00:48:51 +00:00
|
|
|
|
|
|
|
|
|