public override void Evaluate(ActionUsingNode node) { if (_isWaiting) { if (TimeManager.Time >= node.ActionEvent.TimeStart + WaitTime) { node.AdvanceEvent(); } return; } if (!PlayerInputSystem.GetButton(ChargeInput) || _vitalStat.Current < Cost) { node.AdvanceEvent(); } }
public override bool TryComplete(float dt) { if (base.TryComplete(dt)) { return(true); } if (_owner == null) { return(true); } if (_isWaiting) { if (TimeManager.Time >= TimeEntered + _originalNode.WaitTime) { return(true); } return(false); } if (!PlayerInputSystem.GetButton(_config.ChargeInput) || _vitalStat.Current < _config.Cost) { return(true); } return(false); }
public override void OnInspectorGUI() { var script = (InputDebugger)target; if (!Game.GameActive || !Application.isPlaying) { EditorGUILayout.LabelField("Game Not Active"); return; } EditorGUILayout.LabelField(string.Format("Time: {0}", TimeManager.Time.ToString("F4"))); EditorGUILayout.LabelField(string.Format("Look: {0}", PlayerInputSystem.LookInput)); EditorGUILayout.LabelField(string.Format("Move: {0}", PlayerInputSystem.MoveInput)); EditorGUILayout.LabelField(string.Format("IsCursorOverUI: {0}", PlayerInputSystem.IsCursorOverUI)); if (script.CheckButtons != null) { for (int i = 0; i < script.CheckButtons.Length; i++) { var button = script.CheckButtons[i]; if (string.IsNullOrEmpty(button)) { continue; } EditorGUILayout.LabelField(string.Format("{0} is down: {1}", button, PlayerInputSystem.GetButton(button))); } } //if (GUILayout.Button("Test")) {} base.OnInspectorGUI(); }