37 lines
811 B
C#
37 lines
811 B
C#
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using BangerTypes;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UIElements;
|
||
|
|
||
|
namespace UITypes
|
||
|
{
|
||
|
|
||
|
public class NoteElement : VisualElement
|
||
|
{
|
||
|
[UnityEngine.Scripting.Preserve]
|
||
|
public new class UxmlFactory : UxmlFactory<NoteElement> { }
|
||
|
|
||
|
public Note note;
|
||
|
|
||
|
public void Init(Note note)
|
||
|
{
|
||
|
AddToClassList("NoteElement");
|
||
|
|
||
|
AddToClassList(note.a[..1].ToUpper() + note.a[1..] + "Note");
|
||
|
|
||
|
this.note = note;
|
||
|
}
|
||
|
|
||
|
public void UpdateMargin(float timestamp)
|
||
|
{
|
||
|
style.marginTop = new((note.t - timestamp) / 1000f);
|
||
|
}
|
||
|
|
||
|
public bool CheckSelf(float timestamp)
|
||
|
{
|
||
|
return note.t - timestamp < 0;
|
||
|
}
|
||
|
}
|
||
|
}
|