48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Convention;
|
|
using UnityEngine;
|
|
|
|
namespace Demo.Game
|
|
{
|
|
public class DDT : ScriptableObject, IEnumerable<float>
|
|
{
|
|
public static DDT Make()
|
|
{
|
|
return new GameObject().AddComponent<DDT>();
|
|
}
|
|
|
|
public List<float> Datas = new();
|
|
|
|
[Convention.RScript.Variable.Attr.Method]
|
|
public void Add(float value)
|
|
{
|
|
Datas.Add(value);
|
|
}
|
|
|
|
[Convention.RScript.Variable.Attr.Method]
|
|
public void Add(int barSplitTimes, int barCount, int tickCount)
|
|
{
|
|
Datas.Add((barCount + tickCount / (float)barSplitTimes) * OneBarTime);
|
|
}
|
|
|
|
[Convention.RScript.Variable.Attr.Method]
|
|
public float At(int index)
|
|
{
|
|
return Datas[index];
|
|
}
|
|
|
|
public IEnumerator<float> GetEnumerator()
|
|
{
|
|
return ((IEnumerable<float>)Datas).GetEnumerator();
|
|
}
|
|
|
|
IEnumerator IEnumerable.GetEnumerator()
|
|
{
|
|
return ((IEnumerable)Datas).GetEnumerator();
|
|
}
|
|
|
|
public int Count => Datas.Count;
|
|
}
|
|
}
|