public void Initialize() { navMeshAgent = GetComponent <NavMeshAgent>(); rb = GetComponent <Rigidbody>(); col = GetComponent <Collider>(); nc_info = GetComponent <NC_Information>(); if (Patrol) { nc_patrol = GetComponent <NC_Patrol>(); nc_patrol.AssignProperties(navMeshAgent, nc_info); nc_patrol.CacheWaypoints(); nc_patrol.SetupWaypoints(navMeshAgent); } nc_sensors = GetComponent <NC_Sensors>(); if (Weaponized) { nc_weapon = GetComponent <NC_Weapon>(); nc_weapon.weapon = nc_weapon.GetComponentInChildren <Weapon>(); } healthClass = GetComponent <HealthClass>(); controller = GetComponent <pNC_StateMachineController>(); }
public void AssignProperties(NavMeshAgent navMeshAgent, NC_Information nc_info) { navMeshAgent.speed = nc_info.MaxMoveSpeed; navMeshAgent.stoppingDistance = nc_info.StoppingDist; navMeshAgent.angularSpeed = nc_info.AngularSpeed; }