Created
June 11, 2016 00:49
-
-
Save flushpot1125/51b83fc7aa04d69a43f2fa6fa13b87ed to your computer and use it in GitHub Desktop.
Clicking button emulation at 4 sec interval
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
namespace StructureAR | |
{ | |
public class AutoScanController : MonoBehaviour { | |
[SerializeField] Button button; | |
private float timeOut=4.0f; | |
private float timeElapsed; | |
void Update(){ | |
timeElapsed += Time.deltaTime; | |
if(timeElapsed >= timeOut) { | |
generateFrameAndDisappear (); | |
timeElapsed = 0.0f; | |
} | |
} | |
private void generateFrameAndDisappear(){ | |
button.onClick.Invoke (); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment