You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
641 B
36 lines
641 B
10 years ago
|
using UnityEngine;
|
||
|
using System;
|
||
|
using System.Collections;
|
||
|
|
||
10 years ago
|
namespace Fungus
|
||
10 years ago
|
{
|
||
10 years ago
|
[CommandInfo("Scripting",
|
||
|
"Wait",
|
||
10 years ago
|
"Waits for period of time before executing the next command in the sequence.")]
|
||
10 years ago
|
public class Wait : Command
|
||
10 years ago
|
{
|
||
10 years ago
|
[Tooltip("Duration to wait for")]
|
||
10 years ago
|
public float duration = 1;
|
||
10 years ago
|
|
||
10 years ago
|
public override void OnEnter()
|
||
10 years ago
|
{
|
||
|
Invoke ("OnWaitComplete", duration);
|
||
|
}
|
||
|
|
||
|
void OnWaitComplete()
|
||
|
{
|
||
10 years ago
|
Continue();
|
||
10 years ago
|
}
|
||
10 years ago
|
|
||
|
public override string GetSummary()
|
||
|
{
|
||
|
return duration.ToString() + " seconds";
|
||
|
}
|
||
10 years ago
|
|
||
|
public override Color GetButtonColor()
|
||
|
{
|
||
|
return new Color32(235, 191, 217, 255);
|
||
|
}
|
||
10 years ago
|
}
|
||
|
|
||
|
}
|