스페이스바 누름 구현

This commit is contained in:
김도환
2026-05-01 04:03:39 +09:00
parent 425863e9c9
commit 162b58c17d
392 changed files with 115972 additions and 1142 deletions

32
Assets/Scripts/Gazuaa.cs Normal file
View File

@@ -0,0 +1,32 @@
using System;
using UnityEngine;
using UnityEngine.InputSystem;
public class Gazuaa : MonoBehaviour
{
private GazuaInput _gazuaInput;
public GameObject map;
public GameObject avatarPrefab;
private void Awake()
{
_gazuaInput = new GazuaInput();
_gazuaInput.Enable();
_gazuaInput.Player.Gacha.performed += Gacha;
}
private void Gacha(InputAction.CallbackContext obj)
{
var result = Randomizer.GetResult();
for(var i = 0; i < result; i++) Instantiate(avatarPrefab, map.transform);
}
private void OnDisable()
{
_gazuaInput.Disable();
}
}