50 lines
874 B
C#
50 lines
874 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using EventParts;
|
|
using Godot;
|
|
using Godot.Bridge;
|
|
using Godot.NativeInterop;
|
|
|
|
[ScriptPath("res://Scripts/Events/EventParts/WaitFinished.cs")]
|
|
public partial class WaitFinished : Node, EventPart
|
|
{
|
|
[Export(PropertyHint.None, "")]
|
|
private Node[] waitFor;
|
|
|
|
private List<EventPart> p = new List<EventPart>();
|
|
|
|
public bool parallel { get; set; }
|
|
|
|
public EventController parent { get; set; }
|
|
|
|
public Coroutine routine { get; set; }
|
|
|
|
public override void _EnterTree()
|
|
{
|
|
for (int i = 0; i < waitFor.Length; i++)
|
|
{
|
|
p.Add((EventPart)waitFor[i]);
|
|
}
|
|
}
|
|
|
|
public IEnumerator Routine()
|
|
{
|
|
bool flag;
|
|
do
|
|
{
|
|
yield return null;
|
|
flag = false;
|
|
for (int i = 0; i < p.Count; i++)
|
|
{
|
|
if (!p[i].routine.done)
|
|
{
|
|
flag = true;
|
|
}
|
|
}
|
|
}
|
|
while (flag);
|
|
}
|
|
|
|
}
|