/** * <summary>A Constructor in which the unique identifier is explicitly set.</summary> * <param name = "_ID">The unique identifier</param> */ public ActiveInput(int _ID) { inputName = string.Empty; gameState = GameState.Normal; actionListAsset = null; enabledOnStart = true; ID = _ID; inputType = SimulateInputType.Button; buttonType = ActiveInputButtonType.OnButtonDown; axisThreshold = 0.2f; }
public void ShowGUI() { string defaultName = "ActiveInput_" + Label; label = CustomGUILayout.TextField("Label:", label, string.Empty, "An Editor-friendly name"); inputName = CustomGUILayout.TextField("Input button:", inputName, string.Empty, "The name of the Input button, as defined in the Input Manager"); inputType = (SimulateInputType)CustomGUILayout.EnumPopup("Input type:", inputType, string.Empty, "What type of input is expected"); if (inputType == SimulateInputType.Axis) { axisThreshold = CustomGUILayout.Slider("Axis threshold:", axisThreshold, -1f, 1f, string.Empty, "The threshold value for the axis to trigger the ActionListAsset"); } else if (inputType == SimulateInputType.Button) { buttonType = (ActiveInputButtonType)CustomGUILayout.EnumPopup("Responds to:", buttonType, string.Empty, "What type of button press this responds to"); } enabledOnStart = CustomGUILayout.Toggle("Enabled by default?", enabledOnStart, string.Empty, "If True, the active input is enabled when the game begins"); gameState = (GameState)CustomGUILayout.EnumPopup("Available when game is:", gameState, string.Empty, "What state the game must be in for the actionListAsset to run"); actionListAsset = ActionListAssetMenu.AssetGUI("ActionList when triggered:", actionListAsset, defaultName, string.Empty, "The ActionListAsset to run when the input button is pressed"); }
/** * The default Constructor. */ public ActiveInput(int[] idArray) { inputName = string.Empty; gameState = GameState.Normal; actionListAsset = null; enabledOnStart = true; ID = 1; inputType = SimulateInputType.Button; buttonType = ActiveInputButtonType.OnButtonDown; axisThreshold = 0.2f; // Update id based on array foreach (int _id in idArray) { if (ID == _id) { ID++; } } }