using System; using System.Collections; using System.Collections.Generic; using Ichni.RhythmGame.Beatmap; using UnityEngine; using Object = UnityEngine.Object; namespace Ichni.RhythmGame { public abstract class NoteJudgeUnit : IBaseElement { public NoteBase note; public bool isShowingJudge; public RectTransform judgeHintImage; protected abstract GameObject GetHintImagePrefab(); public BaseElement_BM matchedBM { get; set; } protected NoteJudgeUnit(NoteBase note) { this.note = note; } public virtual void SetShowingJudge(bool isShowing) { isShowingJudge = isShowing; if (isShowing) { judgeHintImage = Object.Instantiate(GetHintImagePrefab(), GameManager.instance.judgeHintCanvas.transform).GetComponent(); } else if (judgeHintImage is not null) { Object.Destroy(judgeHintImage.gameObject); } } public virtual void UpdateJudge() { } public virtual bool CheckJudgeAvailability(InputUnit inputUnit) { throw new NotImplementedException(); } /// /// 转换为存档类 /// /// public abstract NoteJudgeUnit_BM ConvertToBM(); } namespace Beatmap { public abstract class NoteJudgeUnit_BM { public NoteJudgeUnit_BM() { } /// /// 转换为游戏类 /// /// public abstract NoteJudgeUnit ConvertToGameType(NoteBase attachedGameElement); } } }