버튼 누르고 있는 시간 조절

This commit is contained in:
Ino 2025-01-25 06:17:32 +09:00
parent f71e1d0ba9
commit 20569ecaa3
4 changed files with 30 additions and 3 deletions

View File

@ -0,0 +1,17 @@
#if UNITY_EDITOR
using UnityEditor;
[CustomEditor(typeof(ButtonPress))]
public class ButtonPressEditor : Editor
{
public override void OnInspectorGUI()
{
DrawDefaultInspector(); // 기본 필드 포함
//ButtonPress buttonPress = (ButtonPress)target;
// LongPressDuration을 인스펙터에 추가
//buttonPress.LongPressDuration = EditorGUILayout.FloatField("Long Press Duration", buttonPress.LongPressDuration);
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: edf263230bf8d784b94692db1f6b2ece
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1022,6 +1022,7 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
LongPressDuration: 0
--- !u!1 &9114692330763557405
GameObject:
m_ObjectHideFlags: 0

View File

@ -1,5 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
@ -8,7 +6,7 @@ public class ButtonPress : UnityEngine.UI.Button
private bool _handled;
private bool _pressed;
private float _pressedTime;
private float LongPressDuration = 0.9f;
public float LongPressDuration = 0.9f;
public override void OnPointerExit(PointerEventData eventData)
{