Tanoda
DelayAction.cs
Go to the documentation of this file.
1
using
System;
2
using
System.Collections;
3
using
System.Collections.Generic;
4
using
UnityEngine
;
5
using
UnityEngine
.
Events
;
6
7
public
class
DelayAction
: MonoBehaviour
8
{
9
public
bool
autostart
=
false
;
10
public
float
delay
= 1.0f;
11
public
UnityEvent
action
;
12
13
private
void
Start()
14
{
15
if
(
autostart
)
16
{
17
Trigger
();
18
}
19
}
20
21
public
void
Trigger
()
22
{
23
StartCoroutine(Delay());
24
}
25
26
private
IEnumerator Delay()
27
{
28
yield
return
new
WaitForSeconds(
delay
);
29
action
.Invoke();
30
}
31
}
DelayAction
Definition:
DelayAction.cs:8
DelayAction.Trigger
void Trigger()
Definition:
DelayAction.cs:21
DelayAction.action
UnityEvent action
Definition:
DelayAction.cs:11
DelayAction.autostart
bool autostart
Definition:
DelayAction.cs:9
DelayAction.delay
float delay
Definition:
DelayAction.cs:10
UnityEngine.Events
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
Scripts
DelayAction.cs
Generated by
1.9.3