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); } }
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; } }
public IAction InstallInView(IModelView view) { IAction retval = null; IOptionItem viewItem = view.GetViewItem(target); if (viewItem != null) { retval = new SetEnabledAction(viewItem, invert); } return(retval); }
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; } }