97bf433381
feat: add btn jump.
30 lines
713 B
C#
30 lines
713 B
C#
using BrewMonster.Network;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace BrewMonster.UI
|
|
{
|
|
public class JumpBtn : MonoBehaviour
|
|
{
|
|
Button jumpBtn;
|
|
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
if(jumpBtn == null)
|
|
{
|
|
jumpBtn = GetComponent<Button>();
|
|
jumpBtn.onClick.AddListener(OnClickBtnJump);
|
|
}
|
|
}
|
|
|
|
private void OnClickBtnJump()
|
|
{
|
|
if(EC_Game.GetGameRun()?.GetHostPlayer() != null)
|
|
{
|
|
EC_Game.GetGameRun()?.GetHostPlayer().OnClickBtnJump();
|
|
}
|
|
}
|
|
}
|
|
}
|