public void UnRegiRecord(RecordTime record) { if (records.Contains(record)) { records.Remove(record); } }
void Refresh() { var it = records.GetEnumerator(); while (it.MoveNext()) { RecordTime rt = it.Current; // 更新 rt.currTime += Time.deltaTime; //判断 if (rt.onTrigger != null && rt.triggerTime != 0f) { if (rt.currTime >= rt.triggerTime) { rt.onTrigger(); if (rt.isRepeat) { rt.currTime = 0f; } else { UnRegiRecord(it.Current); } } } } }
public void RegiRecord(RecordTime record) { if (!records.Contains(record)) { records.Add(record); } }