feat: SongCreator 씬 완성 — Beat Sage URL 지원, info.dat 메타데이터 자동 추출
- 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>
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace VRSDK.Climbing
|
||||
{
|
||||
public class ClimbPoint : VR_Grabbable
|
||||
{
|
||||
[SerializeField] private ClimbingTarget target = null;
|
||||
[SerializeField] private float dropRange = 0.2f;
|
||||
|
||||
private Vector3 startGrabPos = Vector3.zero;
|
||||
private Vector3 startLocalPos = Vector3.zero;
|
||||
public bool isActive = false;
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
|
||||
target = FindObjectOfType<ClimbingTarget>();
|
||||
onGrabStateChange.AddListener( OnGrabStateChangeClimb );
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if ( IsActiveOrGrabbed() )
|
||||
return;
|
||||
|
||||
if (ShouldDropClimbPoint())
|
||||
{
|
||||
ForceDrop();
|
||||
}
|
||||
}
|
||||
|
||||
private float CalculateDistanceToHand()
|
||||
{
|
||||
return Vector3.Distance(GetCurrentHandInteractSettings().interactPoint.position, GrabController.OriginalParent.position);
|
||||
}
|
||||
|
||||
private bool IsActiveOrGrabbed()
|
||||
{
|
||||
return isActive || currentGrabState != GrabState.Grab;
|
||||
}
|
||||
|
||||
private bool ShouldDropClimbPoint()
|
||||
{
|
||||
float d = CalculateDistanceToHand();
|
||||
|
||||
return d > dropRange;
|
||||
}
|
||||
|
||||
private void OnGrabStateChangeClimb(GrabState state)
|
||||
{
|
||||
if (state == GrabState.Grab)
|
||||
{
|
||||
transform.SetParent(null);
|
||||
Destroy(GrabController.GrabPoint.GetComponent<Joint>());
|
||||
GrabController.UseRotationOffset = false;
|
||||
GrabController.SetPositionControlMode(MotionControlMode.Free);
|
||||
GrabController.transform.SetParent(null);
|
||||
GrabController.transform.position = GetCurrentHandInteractSettings().interactPoint.position;
|
||||
GrabController.transform.rotation = Quaternion.Euler( GetCurrentHandInteractSettings().rotationOffset ) * GrabController.RotationOffset;
|
||||
rb.isKinematic = true;
|
||||
target.AddActiveClimbPoint(this);
|
||||
}
|
||||
else if (state == GrabState.Drop)
|
||||
{
|
||||
isActive = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SetClimbingPosition()
|
||||
{
|
||||
if (currentGrabState == GrabState.Grab)
|
||||
{
|
||||
Vector3 positionDiff = GrabController.OriginalParent.localPosition - startLocalPos;
|
||||
positionDiff *= -1;
|
||||
Vector3 worldPos = VR_Manager.instance.Player.TrackingSpace.rotation * positionDiff;
|
||||
target.transform.position = (startGrabPos + worldPos);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnClimbPointActive()
|
||||
{
|
||||
startLocalPos = GrabController.OriginalParent.localPosition;
|
||||
startGrabPos = target.transform.position;
|
||||
isActive = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3804073d29ca83f41b35dbf7c5862e62
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Modules/VRSDK/Climbing/ClimbPoint.cs
|
||||
uploadId: 546658
|
||||
@@ -0,0 +1,85 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace VRSDK.Climbing
|
||||
{
|
||||
/// <summary>
|
||||
/// Use this script in the GameObject being affected by climbing in our case the Player gameObject
|
||||
/// </summary>
|
||||
public class ClimbingTarget : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private UnityEvent onClimbStart = null;
|
||||
[SerializeField] private UnityEvent onClimbEnd = null;
|
||||
|
||||
private List<ClimbPoint> climbPointList = new List<ClimbPoint>();
|
||||
private ClimbPoint activeClimbPoint = null;
|
||||
|
||||
public UnityEvent OnClimbStart { get { return onClimbStart; } }
|
||||
public UnityEvent OnClimbEnd { get { return onClimbEnd; } }
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (activeClimbPoint != null)
|
||||
{
|
||||
activeClimbPoint.SetClimbingPosition();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnClimbPointReleased(ClimbPoint climbPoint)
|
||||
{
|
||||
climbPointList.Remove(climbPoint);
|
||||
|
||||
if (activeClimbPoint == climbPoint)
|
||||
{
|
||||
activeClimbPoint = GetActiveClimbPoint();
|
||||
|
||||
if (activeClimbPoint != null)
|
||||
{
|
||||
activeClimbPoint.OnClimbPointActive();
|
||||
}
|
||||
else
|
||||
{
|
||||
onClimbEnd.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void AddActiveClimbPoint(ClimbPoint climbPoint)
|
||||
{
|
||||
climbPointList.Add(climbPoint);
|
||||
|
||||
climbPoint.OnGrabStateChange.AddListener( delegate(GrabState state)
|
||||
{
|
||||
if (state == GrabState.Drop)
|
||||
{
|
||||
OnClimbPointReleased(climbPoint);
|
||||
}
|
||||
} );
|
||||
|
||||
if (activeClimbPoint == null)
|
||||
{
|
||||
activeClimbPoint = GetActiveClimbPoint();
|
||||
|
||||
if (activeClimbPoint != null)
|
||||
{
|
||||
activeClimbPoint.OnClimbPointActive();
|
||||
onClimbStart.Invoke();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private ClimbPoint GetActiveClimbPoint()
|
||||
{
|
||||
if (climbPointList.Count == 0)
|
||||
return null;
|
||||
|
||||
return climbPointList[0];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1ec8244b089c744abb68d250d178409
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 168243
|
||||
packageName: VR Beats Kit
|
||||
packageVersion: 2.0
|
||||
assetPath: Assets/VRBeatsKit/Modules/VRSDK/Climbing/ClimbingTarget.cs
|
||||
uploadId: 546658
|
||||
Reference in New Issue
Block a user