Commit d6bf6597 authored by Sebastian's avatar Sebastian

added variable to see if player is infusing an element

parent e81eb1c0
...@@ -82,6 +82,7 @@ namespace _Game.Scripts.Player ...@@ -82,6 +82,7 @@ namespace _Game.Scripts.Player
_rigidbody2D.bodyType = RigidbodyType2D.Static; _rigidbody2D.bodyType = RigidbodyType2D.Static;
_elementType = _currentObject.tag; _elementType = _currentObject.tag;
_elementScript = _targetScript; _elementScript = _targetScript;
state.isCharging = true;
Invoke("SuckIt", infusingTime); Invoke("SuckIt", infusingTime);
} }
...@@ -129,6 +130,8 @@ namespace _Game.Scripts.Player ...@@ -129,6 +130,8 @@ namespace _Game.Scripts.Player
_elementScript.InfuseElement(); _elementScript.InfuseElement();
_rigidbody2D.bodyType = RigidbodyType2D.Dynamic; _rigidbody2D.bodyType = RigidbodyType2D.Dynamic;
state.isCharging = false;
} }
private void OnTriggerEnter2D(Collider2D other) private void OnTriggerEnter2D(Collider2D other)
......
...@@ -20,6 +20,8 @@ namespace _Game.Scripts.Scriptable_Object ...@@ -20,6 +20,8 @@ namespace _Game.Scripts.Scriptable_Object
[SerializeField] private ElementGameEvent onElementInfused; [SerializeField] private ElementGameEvent onElementInfused;
[SerializeField] private ChargeGameEvent onChargeChange; [SerializeField] private ChargeGameEvent onChargeChange;
public bool isCharging = false;
[SerializeField][Range(0, 5)] private int charges; [SerializeField][Range(0, 5)] private int charges;
// [SerializeField] private float currentJumpForce; // [SerializeField] private float currentJumpForce;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment