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>
87 lines
2.6 KiB
C#
87 lines
2.6 KiB
C#
using UnityEngine;
|
|
|
|
namespace VRSDK
|
|
{
|
|
public class VR_Outline : MonoBehaviour
|
|
{
|
|
[HideInInspector]
|
|
public float outlineActive = 0;
|
|
|
|
public float outlineThickness = 1f;
|
|
public Color outlineColor = new Color( 49.0f / 255.0f, 246.0f / 255.0f, 0 / 255.0f );
|
|
|
|
private Material outlineMaterial;
|
|
|
|
private GameObject outlineModel;
|
|
private Material outlineModelMaterial;
|
|
|
|
private float lastIsActive = 100;
|
|
|
|
|
|
void Start()
|
|
{
|
|
outlineMaterial = Resources.Load( "OutlineMaterial" ) as Material;
|
|
|
|
this.RefreshHighlightMesh();
|
|
}
|
|
|
|
|
|
void Update()
|
|
{
|
|
if (this.lastIsActive != this.outlineActive)
|
|
{
|
|
outlineModelMaterial.SetFloat( "_Alpha", this.outlineActive );
|
|
outlineModelMaterial.SetFloat( "_Thickness", this.outlineThickness );
|
|
outlineModelMaterial.SetColor( "_OutlineColor", (Color) this.outlineColor );
|
|
this.lastIsActive = this.outlineActive;
|
|
|
|
if (this.outlineActive > 0)
|
|
{
|
|
this.outlineModel.SetActive( true );
|
|
}
|
|
else
|
|
{
|
|
this.outlineModel.SetActive( false );
|
|
}
|
|
}
|
|
}
|
|
|
|
public void RefreshHighlightMesh()
|
|
{
|
|
if (this.outlineModel != null)
|
|
{
|
|
Destroy( outlineModel );
|
|
}
|
|
|
|
MeshFilter[] meshFilters = GetComponentsInChildren<MeshFilter>();
|
|
CombineInstance[] combine = new CombineInstance[meshFilters.Length];
|
|
int i = 0;
|
|
while (i < meshFilters.Length)
|
|
{
|
|
combine[i].mesh = meshFilters[i].sharedMesh;
|
|
combine[i].transform = gameObject.transform.worldToLocalMatrix * meshFilters[i].transform.localToWorldMatrix;
|
|
|
|
i++;
|
|
}
|
|
|
|
|
|
this.outlineModel = new GameObject( name + "OutlineModel" );
|
|
outlineModel.transform.SetParent( this.gameObject.transform, false );
|
|
|
|
MeshFilter filter = outlineModel.AddComponent<MeshFilter>();
|
|
filter.mesh = new Mesh();
|
|
filter.mesh.CombineMeshes( combine );
|
|
|
|
MeshRenderer renderer = outlineModel.AddComponent<MeshRenderer>();
|
|
renderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
|
|
renderer.receiveShadows = false;
|
|
renderer.material = outlineMaterial;
|
|
this.outlineModelMaterial = renderer.material;
|
|
|
|
this.outlineModel.SetActive( false );
|
|
}
|
|
}
|
|
|
|
}
|
|
|