void SetMainUnit(Transform unit) { playerTransform = unit; playerBody = unit.GetComponent <Rigidbody>(); player = unit.GetComponent <PlayerCharacterUnit>(); playerCollider = unit.GetComponent <Collider>(); }
private void Start() { GW_Player = GameObject.Find("Player").GetComponent <PlayerCharacterUnit>(); GW_PlayerCamera = Camera.main; UnityEngine.Object[] tempAbilityList = Resources.LoadAll("SO/Abilities", typeof(ScriptableObject)); UnityEngine.Object[] tempStatusList = Resources.LoadAll("SO/Statuses", typeof(ScriptableObject)); GW_CharacterPanel = GameObject.Find("UIController").GetComponent <CharacterPanelScripts>(); Cursor.lockState = CursorLockMode.Locked; }
public static PlayerCharacterUnit GetInAreaPlayer(float searchArea, Vector3 searchPoint) { PlayerCharacterUnit player = null; var search = Physics.OverlapSphere(searchPoint, searchArea, 1 << 12).FirstOrDefault(); if (search != null) { player = search.GetComponent <PlayerCharacterUnit>(); } if (player != null) { return(player); } else { return(null); } }