public override void OnEnter() { base.OnEnter(); Component mComponent = ((GameObject)gameObject.Value).GetComponent(component); if (mComponent is MonoBehaviour) { MonoBehaviour behaviour = mComponent as MonoBehaviour; if (repeatRate.Value == 0) { behaviour.Invoke(methodName, delay.Value); } else { behaviour.InvokeRepeating(methodName, delay.Value, repeatRate.Value); } } else { GameObject instance = new GameObject("RoutineHandler"); CoroutineInstance routineHandler = instance.AddComponent <CoroutineInstance>(); if (repeatRate.Value == 0) { routineHandler.ProcessWork(InvokeMethod(mComponent)); } else { routineHandler.StartCoroutine(InvokeRepeatingMethod(mComponent)); } } Finish(); }
public override void OnEnter () { string serverAddress = PlayerPrefs.GetString ("ServerAddress"); if (string.IsNullOrEmpty (serverAddress)) { Debug.Log ("Please initialize the database to save values. Use MySQL.Initialize"); } else { GameObject instance = new GameObject (); CoroutineInstance routineHandler = instance.AddComponent<CoroutineInstance> (); routineHandler.StartCoroutine (DeleteEntry(serverAddress, key.Value)); instance.hideFlags = HideFlags.HideInHierarchy; } Finish (); }