Ejemplo n.º 1
0
 // returns if performed any action
 public bool PerformAction(GameEventAction Action)
 {
     if (Action.actionType == GameEventAction.ActionType.TriggerEvent) {
         if (Action.triggerEvent) {
             Action.triggerEvent.OnTriggered();
             return true;
         }
     } else if (Action.actionType == GameEventAction.ActionType.SetObjectState) {
         InteractiveObject o = Action.targetObject;
         if (o == null) {
             o = transform.parent.parent.GetComponentInChildren<InteractiveObject>();
         }
         if (o == null) {
             return false;
         }
         o.SetState(Action.targetState);
         return true;
     }
     return false;
 }
 // actually fire the event
 public void Broadcast()
 {
     GameEventAction?.Invoke();
 }