Commit 4be6549a authored by Patrick Stengel's avatar Patrick Stengel
Browse files

i promise my last next next next System change

parent a63f8fd5
......@@ -7,21 +7,41 @@ using UnityEngine.Serialization;
namespace _Game.Scripts.Input {
public class SwitchPlayerManager : MonoBehaviour {
[SerializeField] private string characterTag;
[SerializeField] private MovementBase movement;
[SerializeField] private UseMutation mutation;
public void OnMovement(InputValue value) {
if (movement == null) return;
public MovementBase Movement{
get
{
if (movement == null || !movement.gameObject.tag.Equals(characterTag)) {
movement = GameObject.FindWithTag(characterTag).GetComponent<MovementBase>();
}
return movement;
}
}
movement.OnMovement(value);
public UseMutation Mutation {
get {
if (mutation == null || !mutation.gameObject.tag.Equals(characterTag)) {
mutation = GameObject.FindWithTag(characterTag).GetComponent<UseMutation>();
}
return mutation;
}
}
public void OnMovement(InputValue value) {
Movement.OnMovement(value);
}
public void OnAbility1() {
mutation.OnAbility1();
Mutation.OnAbility1();
}
public void OnAbility2() {
mutation.OnAbility2();
Mutation.OnAbility2();
}
}
}
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