mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 06:25:42 +00:00
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace X10D.Unity.Tests
|
|
{
|
|
public class YieldInstructionIntegrationTests : MonoBehaviour
|
|
{
|
|
private void Start()
|
|
{
|
|
StartCoroutine(CO_WaitForAnyKeyDown());
|
|
StartCoroutine(CO_WaitForSpaceKeyDown());
|
|
StartCoroutine(CO_WaitForSpaceKeyUp());
|
|
}
|
|
|
|
private IEnumerator CO_WaitForAnyKeyDown()
|
|
{
|
|
Debug.Log("Waiting for any key to be pressed...");
|
|
yield return new WaitForKeyDown();
|
|
Debug.Log("Key was pressed!");
|
|
}
|
|
|
|
private IEnumerator CO_WaitForSpaceKeyDown()
|
|
{
|
|
Debug.Log("Waiting for Space key to be pressed...");
|
|
yield return new WaitForKeyDown(KeyCode.Space);
|
|
Debug.Log("Space key was pressed!");
|
|
}
|
|
|
|
private IEnumerator CO_WaitForSpaceKeyUp()
|
|
{
|
|
Debug.Log("Waiting for Space key to be released...");
|
|
yield return new WaitForKeyUp(KeyCode.Space);
|
|
Debug.Log("Space key was released!");
|
|
}
|
|
}
|
|
}
|