59 lines
1.8 KiB
C#
59 lines
1.8 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni.RhythmGame.Beatmap;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame
|
|
{
|
|
public class FullScreenNearTimeJudgeUnit : NoteJudgeUnit
|
|
{
|
|
protected override GameObject GetHintImagePrefab() => GameManager.instance.basePrefabs.fullscreenNearTimeHint;
|
|
|
|
public FullScreenNearTimeJudgeUnit(NoteBase note) : base(note)
|
|
{
|
|
|
|
}
|
|
|
|
public override void UpdateJudge()
|
|
{
|
|
if(note.isFirstJudged) return;
|
|
Vector2 noteScreenPosition = note.noteScreenPosition;
|
|
RectTransform canvasRect = GameManager.instance.judgeHintCanvas.GetComponent<RectTransform>();
|
|
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRect, noteScreenPosition, null, out Vector2 uiPosition))
|
|
{
|
|
judgeHintImage.anchoredPosition = uiPosition;
|
|
}
|
|
}
|
|
|
|
public override NoteJudgeUnit_BM ConvertToBM()
|
|
{
|
|
return new FullScreenNearTimeJudgeUnit_BM();
|
|
}
|
|
|
|
public override bool CheckJudgeAvailability(InputUnit inputUnit)
|
|
{
|
|
if (inputUnit is InputUnitSwipe swipe && note is Flick flick)
|
|
{
|
|
return flick.CheckSwipeDirection(swipe);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
namespace Beatmap
|
|
{
|
|
public class FullScreenNearTimeJudgeUnit_BM : NoteJudgeUnit_BM
|
|
{
|
|
public FullScreenNearTimeJudgeUnit_BM()
|
|
{
|
|
|
|
}
|
|
|
|
public override NoteJudgeUnit ConvertToGameType(NoteBase attachedNote)
|
|
{
|
|
return new FullScreenNearTimeJudgeUnit(attachedNote);
|
|
}
|
|
}
|
|
}
|
|
} |