/** * <summary>Creates a new instance of the 'Input: QTE' Action, set to detect a single keypress</summary> * <param name = "inputButtonName">The name of the input button to detect</param> * <param name = "duration">The duration of the QTE</param> * <param name = "wrongButtonFails">If True, pressing the wrong button will fail the QTE</param> * <param name = "menuToDisplay">The name of a menu to turn on during the QTE</param> * <param name = "animateUI">If True, the Animator of a Unity UI-based menu will be controlled</param> * <returns>The generated Action</returns> */ public static ActionQTE CreateNew_SingleKeypress(string inputButtonName, float duration, bool wrongButtonFails = false, string menuToDisplay = "", bool animateUI = false) { ActionQTE newAction = (ActionQTE)CreateInstance <ActionQTE>(); newAction.qteType = QTEType.SingleKeypress; newAction.inputName = inputButtonName; newAction.duration = duration; newAction.wrongKeyFails = wrongButtonFails; newAction.menuName = menuToDisplay; newAction.animateUI = animateUI; return(newAction); }
/** * <summary>Creates a new instance of the 'Input: QTE' Action, set to detect a single axis</summary> * <param name = "inputAxisName">The name of the input axis to detect</param> * <param name = "duration">The duration of the QTE</param> * <param name = "axisThreshold">The minimum value that the axis should be to win</param> * <param name = "wrongDirectionFails">If True, then moving the axis in the opposite direction will fail the QTE</param> * <param name = "menuToDisplay">The name of a menu to turn on during the QTE</param> * <param name = "animateUI">If True, the Animator of a Unity UI-based menu will be controlled</param> * <returns>The generated Action</returns> */ public static ActionQTE CreateNew_SingleAxis(string inputAxisName, float duration, float axisThreshold = 0.2f, bool wrongDirectionFails = false, string menuToDisplay = "", bool animateUI = false) { ActionQTE newAction = (ActionQTE)CreateInstance <ActionQTE>(); newAction.qteType = QTEType.SingleAxis; newAction.inputName = inputAxisName; newAction.duration = duration; newAction.axisThreshold = axisThreshold; newAction.wrongKeyFails = wrongDirectionFails; newAction.menuName = menuToDisplay; newAction.animateUI = animateUI; return(newAction); }
/** * <summary>Creates a new instance of the 'Input: QTE' Action, set to detect button-mashing</summary> * <param name = "inputButtonName">The name of the input button to mash</param> * <param name = "duration">The duration of the QTE</param> * <param name = "requiredPresses">The number of times to press the button</param> * <param name = "cooldownTime">If positive, the time after which the registered number of button presses will decrease by one</param> * <param name = "wrongButtonFails">If True, pressing the wrong button will fail the QTE</param> * <param name = "menuToDisplay">The name of a menu to turn on during the QTE</param> * <param name = "animateUI">If True, the Animator of a Unity UI-based menu will be controlled</param> * <returns>The generated Action</returns> */ public static ActionQTE CreateNew_ButtonMash(string inputButtonName, float duration, int requiredPresses, float cooldownTime = -1f, bool wrongButtonFails = false, string menuToDisplay = "", bool animateUI = false) { ActionQTE newAction = (ActionQTE)CreateInstance <ActionQTE>(); newAction.qteType = QTEType.ButtonMash; newAction.inputName = inputButtonName; newAction.duration = duration; newAction.targetPresses = requiredPresses; newAction.cooldownTime = cooldownTime; newAction.doCooldown = (cooldownTime >= 0f); newAction.wrongKeyFails = wrongButtonFails; newAction.menuName = menuToDisplay; newAction.animateUI = animateUI; return(newAction); }