コード例 #1
0
    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);
        }
    }
コード例 #2
0
 public void SetTask(Vector3 moveTo, int unitsCount, int i, MillitarTask task = MillitarTask.Idle )
 {
     currentTask = task;
     MoveTo(moveTo, unitsCount, i);
 }