using UnityEngine; using UnityEngine.AI; using UnityEngine.InputSystem; public class CharacterRoleSetup : MonoBehaviour { public void SetupAsPlayer() { GetComponent().enabled = true; GetComponent().enabled = true; //GetComponent().enabled = false; var agent = GetComponent(); if (agent != null) agent.enabled = false; gameObject.tag = "Player"; } public void SetupAsEnemy(Transform target) { GetComponent().enabled = false; //GetComponent().enabled = true; //GetComponent().target = target; var agent = GetComponent(); if (agent != null) agent.enabled = true; var input = GetComponent(); if (input != null) input.enabled = false; gameObject.tag = "Enemy"; } }