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>
48 lines
1.7 KiB
C#
48 lines
1.7 KiB
C#
using UnityEngine;
|
|
using System.Collections.Generic;
|
|
|
|
namespace VRSDK.Locomotion
|
|
{
|
|
//this is a preset for a parabolic teleport
|
|
[CreateAssetMenu(fileName = "ParabolicTeleporPreset", menuName = "VRShooterKit/Create Parabolic Teleport Preset")]
|
|
public class VR_ParabolicAimHandler : VR_TeleportAimHandler
|
|
{
|
|
[SerializeField] protected float projectileSpeed = 15.0f;
|
|
[SerializeField] protected float gravity = 9.8f;
|
|
[Tooltip("The fps for the fake projectile use for generate a parabolic line, more fps will produce more points so be careful")]
|
|
[Range(10 , 75)]
|
|
[SerializeField] protected int simulatedFPS = 40;
|
|
|
|
|
|
public override List<Vector3> GetAllPoints(Ray aimRay)
|
|
{
|
|
//calculate the fake delta time
|
|
float deltaTime = 1.0f / (float) simulatedFPS;
|
|
|
|
//calculate initial speed
|
|
Vector3 m = aimRay.direction * projectileSpeed * deltaTime;
|
|
Vector3 projectilePos = aimRay.origin;
|
|
|
|
List<Vector3> points = new List<Vector3>();
|
|
|
|
|
|
//we calculate the distance of the fake projectil using just x,z so it looks better
|
|
float squareRange = range * range;
|
|
Vector2 origin = new Vector2(aimRay.origin.x , aimRay.origin.z);
|
|
|
|
while ( (origin - new Vector2( projectilePos.x , projectilePos.z )).sqrMagnitude < squareRange)
|
|
{
|
|
points.Add( projectilePos );
|
|
//add gravity
|
|
m -= Vector3.up * gravity * deltaTime;
|
|
//move our fake projectil
|
|
projectilePos += m;
|
|
}
|
|
|
|
return points;
|
|
}
|
|
}
|
|
|
|
}
|
|
|