public void SetTask(GameObject selectedTaskObject) { // Space objects are attackable objects such as People and Buildings var enemyTarget = selectedTaskObject.GetComponent<SpaceObject>(); if(enemyTarget != null) { currentTask = MillitarTask.Attack; swordsAttacking = null; swordsAttacking = new SwordsmanAttackingState(enemyTarget, this.gameObject, enemySeekingRange); } }
public void SetTask(Vector3 moveTo, int unitsCount, int i, MillitarTask task = MillitarTask.Idle ) { currentTask = task; MoveTo(moveTo, unitsCount, i); }