|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) |
|
|
|
|
|
|
|
|
|
using UnityEngine; |
|
|
|
|
using System.Collections; |
|
|
|
|
|
|
|
|
|
namespace Fungus |
|
|
|
|
{ |
|
|
|
@ -14,8 +15,18 @@ namespace Fungus
|
|
|
|
|
[AddComponentMenu("")] |
|
|
|
|
public class GameStarted : EventHandler |
|
|
|
|
{ |
|
|
|
|
protected virtual void Start() |
|
|
|
|
[Tooltip("Wait for a number of frames after startup before executing the Block. Can help fix startup order issues.")] |
|
|
|
|
[SerializeField] protected int waitForFrames = 1; |
|
|
|
|
|
|
|
|
|
protected virtual IEnumerator Start() |
|
|
|
|
{ |
|
|
|
|
int frameCount = waitForFrames; |
|
|
|
|
while (frameCount > 0) |
|
|
|
|
{ |
|
|
|
|
yield return new WaitForEndOfFrame(); |
|
|
|
|
frameCount--; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ExecuteBlock(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|