Unit delay methods: invoke and invokerepeating

Why can’t you stop buying 618?From the technical dimension to explore>>>

monobehavior has two built-in delay methods

Invoke

one

two

three

Invoke(methodName:

string

, time:

float

):

void

;

methodname: method name

time: how many seconds to execute in

InvokeRepeating

one

two

three

four

InvokeRepeating(methodName:

string

, time:

float

, repeatRate:

float

):

void

;

methodname: method name

time: how many seconds to execute in

repeatrate: repeat interval

There are also two important ways:

Isinvoking: used to determine whether a method has been delayed and is about to be executed

Cancel invoke: cancel all delay methods on the script (note that GameObject. Setactive (false) does not work, which is different from coroutine)

Similar Posts: