Exemplo n.º 1
0
 protected void CreateControl(Action <Controls, Control> attachEventHandlers) =>
 SharedControls.AccessWithRetry(c => {
     ControlMonoBehavior = ControlGameObject.AddComponent <Control>();
     attachEventHandlers(c, ControlMonoBehavior);
     var action = typeof(Controls).GetProperty(ControlMonoBehavior.Name).GetValue(c);
     action.GetType().GetMethod(SharedControls.SetCallbacksMethodName).Invoke(action, new[] { ControlMonoBehavior });
     ControlMonoBehavior.enabled = false;
 });
Exemplo n.º 2
0
 public void DisableControl() =>
 SharedControls.AccessWithRetry(c => {
     var action = typeof(Controls).GetProperty(ControlMonoBehavior.Name).GetValue(c);
     action.GetType().GetMethod(SharedControls.DisableMethodName).Invoke(action, null);
     ControlGameObject.SetActive(false);
 });