public class CheckInRange{
public IEnumerator loopCheckInRange(){
timer += 1;
Debug.Log (timer);
yield return new WaitForSeconds (0.2f);
}
}
---------------------------------------------------------------------------------------------------------------------------------------------------------
In the other class:
public class test : MonoBehaviour {
public CheckInRange checkInrange = new CheckInRange ();
// Use this for initialization
void Start () {
InvokeRepeating("checkInrange.loopCheckInRange",0f,0.2f);
}
}
↧