32 lines
649 B
C#
32 lines
649 B
C#
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();
|
|
}
|
|
|
|
|
|
} |