/// <summary> /// 入力イベント作成 /// </summary> /// <param name="type"></param> public void CreateEvent(PC_Control.Input_st type, float t) { int LatestIndex = 0; // 記録が空なら最初にイベント追加 if (EventList.Count == 0) { EventList.Add(new Input_Event_st(type, t)); } else { // このインプットが最新の場合 if (EventList[EventList.Count - 1].start < t) { EventList.Add(new Input_Event_st(type, t)); } else { //既にあるイベントを書き換える場合 for (var i = 1; i < EventList.Count - 1; i++) { if (EventList[i - 1].start <t && EventList[i + 1].start> t) { LatestIndex = i; break; } } //記録削除 EventList.RemoveRange(LatestIndex, EventList.Count - LatestIndex); Target.ResetInput(); //記録追加 EventList.Insert(LatestIndex, new Input_Event_st(type, t)); ControlRef.CutException(); } } }
public Input_Event_st(PC_Control.Input_st TYPE, float START) { this.type = TYPE; this.start = START; }