コード例 #1
0
 private void TryActions(SetEnabledAction[] actions, Transform actor)
 {
     if (actions == null) return;
     foreach (SetEnabledAction action in actions) {
         if (action != null && action.condition != null && action.condition.IsTrue(actor)) DoAction(action, actor);
     }
 }
コード例 #2
0
 public void DoAction(SetEnabledAction action, Transform actor)
 {
     if (action != null) {
         MonoBehaviour target = Tools.Select(action.target, this);
         bool newValue = ToggleTools.GetNewValue(target.enabled, action.state);
         if (DialogueDebug.LogInfo) Debug.Log(string.Format("{0}: Trigger: {1}.{2}.enabled = {3}", new System.Object[] { DialogueDebug.Prefix, target.name, target.GetType().Name, newValue }));
         target.enabled = newValue;
     }
 }
コード例 #3
0
            public IAction InstallInView(IModelView view)
            {
                IAction     retval   = null;
                IOptionItem viewItem = view.GetViewItem(target);

                if (viewItem != null)
                {
                    retval = new SetEnabledAction(viewItem, invert);
                }
                return(retval);
            }
コード例 #4
0
 public void DoAction(SetEnabledAction action, Transform actor)
 {
     if (action != null)
     {
         MonoBehaviour target   = Tools.Select(action.target, this);
         bool          newValue = ToggleTools.GetNewValue(target.enabled, action.state);
         if (DialogueDebug.LogInfo)
         {
             Debug.Log(string.Format("{0}: Trigger: {1}.{2}.enabled = {3}", new System.Object[] { DialogueDebug.Prefix, target.name, target.GetType().Name, newValue }));
         }
         target.enabled = newValue;
     }
 }