4dad9e5d5b
- BeatSageUploader: audio_url 지원(UploadFromUrl), PollAndDownload 공통화, ZIP 500 오류 3회 재시도 - BeatSageConverter: info.dat 파싱(SongMetadata), BPM 자동 감지 → 노트 타이밍 변환에 적용 - SongCreatorManager: title/BPM 필수 입력 제거, 난이도 4개 자동 선택, GenerateFlowFromUrl 버그 수정 - NasPublisher: audioPath null 허용(URL 흐름에서 로컬 파일 없는 경우 스킵) - .gitignore/.gitattributes 초기 설정 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
81 lines
2.6 KiB
C#
81 lines
2.6 KiB
C#
using UnityEngine;
|
|
|
|
namespace VRSDK
|
|
{
|
|
//this is the basic class for highlight grabbables
|
|
//in used by the VR_OutlineHighlight and the VR_UIHighlight
|
|
public abstract class VR_Highlight : MonoBehaviour
|
|
{
|
|
private VR_Interactable interact = null;
|
|
|
|
public Transform HighlightPointRightHand { get { return interact.HighlightPointRightHand; } }
|
|
public Transform HighlightPointLeftHand { get { return interact.HighlightPointLeftHand; } }
|
|
public float HighlightDistance { get { return interact.InteractDistance; } }
|
|
public bool IsHighlight { get; private set; }
|
|
|
|
public VR_Interactable Interactable
|
|
{
|
|
get { return interact; }
|
|
}
|
|
|
|
protected virtual void Awake()
|
|
{
|
|
interact = GetComponent<VR_Interactable>();
|
|
|
|
if (interact == null)
|
|
{
|
|
Debug.LogError( "VR_Hightlight attached to " + gameObject.name + " needs a interactable script in order to work" );
|
|
}
|
|
|
|
VR_Manager.instance.RegisterHighlight( this );
|
|
}
|
|
|
|
protected virtual void OnDestroy()
|
|
{
|
|
//this object can be destroyed for 2 reasons
|
|
//the programmer calling destroy on the gameobject
|
|
// and the UnityEngine closing the game, so if Unity is closing the game
|
|
//dont do nothing the game is just closing
|
|
if (!VR_Manager.ApplicationIsQuitting)
|
|
VR_Manager.instance.RemoveHighlight( this );
|
|
}
|
|
|
|
protected virtual void OnEnable()
|
|
{
|
|
VR_Manager.instance.RegisterHighlight( this );
|
|
}
|
|
|
|
protected virtual void OnDisable()
|
|
{
|
|
//this object can be disable for 2 reasons
|
|
//the programmer calling destroy on the gameobject
|
|
// and the UnityEngine closing the game, so if Unity is closing the game
|
|
//dont do nothing the game is just closing
|
|
if (!VR_Manager.ApplicationIsQuitting)
|
|
VR_Manager.instance.RemoveHighlight( this );
|
|
}
|
|
|
|
public bool CanHighlight()
|
|
{
|
|
return interact == null || interact.CanInteract;
|
|
}
|
|
|
|
public bool CanHighlightUsingController(VR_Controller controller)
|
|
{
|
|
return interact == null || interact.CanInteractUsingController( controller );
|
|
}
|
|
|
|
|
|
public virtual void Highlight(VR_Controller controller)
|
|
{
|
|
IsHighlight = true;
|
|
}
|
|
public virtual void UnHighlight(VR_Controller controller)
|
|
{
|
|
IsHighlight = false;
|
|
}
|
|
|
|
}
|
|
}
|
|
|