void Start() { // Unit information this.unitType = UnitTypes.Miner; objName = "Miner"; objDescription = "Basic mining unit. Right click on mining node " + "to begin harvesting turns."; this.maxHealth = 50f; this.unitHealth = maxHealth; // Selection circle initiation this.circle = GetComponent <LineRenderer>(); this.isSelected = false; // Get player camera and attached resource manager resourceManager = Camera.main.GetComponent <ResourceManager>(); selectOnClick = Camera.main.GetComponent <SelectOnClick>(); // Task initiation setTask(Tasks.Idle); isGathering = false; navAgent = GetComponent <NavMeshAgent>(); // Set Unit "tell" color to player color // TODO: Mostly for future use. Maybe set tag here and conditionals to NPC tell.GetComponent <MeshRenderer>().material = tellMats[0]; StartCoroutine(GatherTick()); refreshGatherNodes(); }
// Start is called before the first frame update void Start() { // Selection circle initiation this.circle = GetComponent <LineRenderer>(); this.isSelected = false; this.maxHealth = 100f; this.unitHealth = maxHealth; resourceManager = Camera.main.GetComponent <ResourceManager>(); selectOnClick = Camera.main.GetComponent <SelectOnClick>(); navAgent = GetComponent <NavMeshAgent>(); targetEnemy = null; StartCoroutine(AttackTick()); }