public void ScheduleForUpdate() { if (gameObject != null) { GameObjectUpdateScript script = gameObject.AddComponent <GameObjectUpdateScript> (); script.entity = this; } }
public void UnscheduleForUpdates() { GameObjectLateUpdateScript script1 = gameObject.GetComponent <GameObjectLateUpdateScript> (); if (script1 != null) { script1.enabled = false; } GameObjectUpdateScript script2 = gameObject.GetComponent <GameObjectUpdateScript> (); if (script2 != null) { script2.enabled = false; } }