private void TryActions(SetActiveAction[] actions, Transform actor) { if (actions == null) return; foreach (SetActiveAction action in actions) { if (action != null && action.condition != null && action.condition.IsTrue(actor)) DoAction(action, actor); } }
public void DoAction(SetActiveAction action, Transform actor) { if (action != null) { Transform target = Tools.Select(action.target, this.transform); bool newValue = ToggleTools.GetNewValue(target.gameObject.activeSelf, action.state); if (DialogueDebug.LogInfo) Debug.Log(string.Format("{0}: Trigger: {1}.SetActive({2})", new System.Object[] { DialogueDebug.Prefix, target.name, newValue })); target.gameObject.SetActive(newValue); } }
public void DoAction(SetActiveAction action, Transform actor) { if (action != null) { Transform target = Tools.Select(action.target, this.transform); bool newValue = ToggleUtility.GetNewValue(target.gameObject.activeSelf, action.state); if (DialogueDebug.logInfo) { Debug.Log(string.Format("{0}: Trigger: {1}.SetActive({2})", new System.Object[] { DialogueDebug.Prefix, target.name, newValue })); } target.gameObject.SetActive(newValue); } }