Пример #1
0
 public void ScheduleForUpdate()
 {
     if (gameObject != null)
     {
         GameObjectUpdateScript script = gameObject.AddComponent <GameObjectUpdateScript> ();
         script.entity = this;
     }
 }
Пример #2
0
    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;
        }
    }