using UnityEngine;
using System.Collections;
public struct SomeStruct {
public void example (){
Invoke("example1",2);
}
void example1 (){
Debug.Log("asdgsfdgjhsdfgj");
}
}
I get an error:
Assets/Email.cs(6,17): error CS0103: The name `Invoke’ does not exist in the current context
but if I do same thing in class monobehaviour I have no problems whatsoever
is there any possibility to do this in structure?
as I’ve found out that invoke works in update and in start so I do not understand why can’t it work in structure
but if I’d do it this way:
using UnityEngine;
using System.Collections;
public struct SomeStruct {
public IEnumerator Example() {
Debug.Log(""+Time.time);
yield return new WaitForSeconds(1);
Debug.Log(""+Time.time);
}
public void Example1(){
Debug.Log(""+Time.time);
}
}
and if I call example I get nothing at all
and if I call example 1 I get normal debug as I should
and OFC I’m calling it from start