Skip to content
Snippets Groups Projects
Commit 07fd07cb authored by Robin Halseth Sandvik's avatar Robin Halseth Sandvik
Browse files

Test code.

parent 99cac02d
No related branches found
No related tags found
1 merge request!56New ability fire rework. (Charging)
fileFormatVersion: 2
guid: a4433520002352142bf81c89a15742f3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -124,6 +124,7 @@ namespace BigSock { ...@@ -124,6 +124,7 @@ namespace BigSock {
/* /*
Triggers an ability if it should be. Triggers an ability if it should be.
Need to add support for mouse buttons n shiet
*/ */
private void CheckAbilityInput(KeyCode key, IAbility ability) { private void CheckAbilityInput(KeyCode key, IAbility ability) {
var par = GetAbilityParam(Camera.main.ScreenToWorldPoint(Input.mousePosition)); var par = GetAbilityParam(Camera.main.ScreenToWorldPoint(Input.mousePosition));
...@@ -144,7 +145,8 @@ namespace BigSock { ...@@ -144,7 +145,8 @@ namespace BigSock {
// If let go: Activate // If let go: Activate
else if(Input.GetKeyUp(key)) { else if(Input.GetKeyUp(key)) {
par.ChargeTime = Time.time - chargeStarts[key]; par.ChargeTime = Time.time - chargeStarts[key];
ability.Use(par); var t = ability.Use(par);
if(!t) Debug.Log($"[PlayerController.CheckAbilityInput({key})] {ability.Name} not fired ({par.ChargeTime}/{ability.MinCharge})");
} }
break; break;
default: default:
...@@ -176,6 +178,12 @@ namespace BigSock { ...@@ -176,6 +178,12 @@ namespace BigSock {
CheckAbilityInput(KeyCode.Z, _testAttack2); CheckAbilityInput(KeyCode.Z, _testAttack2);
// Check ability 3. // Check ability 3.
CheckAbilityInput(KeyCode.X, _dodge); CheckAbilityInput(KeyCode.X, _dodge);
//if(Input.GetKeyDown(KeyCode.Z)) Debug.Log($"[PlayerController.Update()] Z was pressed.");
//if(Input.GetKeyUp(KeyCode.Z)) Debug.Log($"[PlayerController.Update()] Z was let go.");
//if(Input.GetKeyUp(KeyCode.UpArrow)) Debug.Log($"[PlayerController.Update()] UpArrow was let go.");
//if(Input.GetKeyUp(KeyCode.Space)) Debug.Log($"[PlayerController.Update()] Space was let go.");
//// If pressed Z: Big attack. //// If pressed Z: Big attack.
//if(Input.GetKey(KeyCode.Z)) { //if(Input.GetKey(KeyCode.Z)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment