Files

39 lines
909 B
C#
Raw Permalink Normal View History

2022-10-01 15:40:51 +03:00
using UnityEngine;
public class RightClickEditor : MonoBehaviour
{
2022-10-02 12:58:34 +03:00
[SerializeField] private CharacterEditor _characterEditor = default;
2022-10-01 15:40:51 +03:00
[SerializeField] private GameObject _rightClickWindow = default;
[SerializeField] private GameObject _canvas = default;
2022-10-02 12:58:34 +03:00
private AnimationSO[] _animations;
2022-10-01 15:40:51 +03:00
void Update()
{
2022-10-01 18:02:11 +03:00
if (Input.GetMouseButtonUp(1))
2022-10-01 15:40:51 +03:00
{
if (_canvas.activeSelf)
{
_canvas.SetActive(false);
}
else
{
_canvas.SetActive(true);
_rightClickWindow.transform.position = Input.mousePosition;
}
}
}
public void CreateHurtbox()
{
2022-10-02 12:58:34 +03:00
_characterEditor.CreateHurtbox();
_canvas.SetActive(false);
2022-10-01 15:40:51 +03:00
}
public void CreateHitbox()
{
2022-10-02 12:58:34 +03:00
_characterEditor.CreateHitbox();
_canvas.SetActive(false);
2022-10-01 15:40:51 +03:00
}
}