コード例 #1
0
 private void TryMoveAttack(Unit unit, Vector3 point, int speed, Targeter.AttackType attackType, GameObject main)
 {
     //Debug.Log($"AI Combat TryMoveAttack enemy: {unit}, main: {main}, attack pos: {point} , unit.GetTargeter() {unit.GetTargeter()}");
     //unit.GetTargeter().CmdSetTarget(main, attackType);
     //Debug.Log($"unit.GetUnitMovement(): {unit.GetUnitMovement().name} ");
     //unit.GetUnitMovement().CmdMoveAttack(point, speed);
     //unit.GetUnitMovement().unitNetworkAnimator.SetTrigger("run");
 }
コード例 #2
0
 private void TryTarget(Targetable target, Targeter.AttackType attackType)
 {
     foreach (Unit unit in unitSelectionHandler.SelectedUnits)
     {
         //Debug.Log($"Try Target {target.gameObject} , {attackType}");
         unit.GetTargeter().CmdSetTarget(target.gameObject, attackType);
     }
 }
コード例 #3
0
 private void TryAttack(Unit unit, Targetable target, Targeter.AttackType attackType)
 {
     //foreach (Unit unit in unitSelectionHandler.SelectedUnits)
     //{
     unit.GetTargeter().CmdSetTarget(target.gameObject, attackType);
     // Set or unset the attack animation
     unit.GetUnitMovement().unitNetworkAnimator.SetTrigger("attack");
     //}
 }
コード例 #4
0
 private void TryMoveAttack(Unit unit, Vector3 point, int speed, Targeter.AttackType attackType)
 {
     //Debug.Log($"Move Attack selected unit {unit} , point {point} ");
     //foreach (Unit unit in unitSelectionHandler.SelectedUnits)
     //{
     unit.GetTargeter().CmdSetTarget(target.gameObject, attackType);
     unit.GetUnitMovement().CmdMoveAttack(point, speed);
     unit.GetUnitMovement().unitNetworkAnimator.SetTrigger("run");
     //}
 }
コード例 #5
0
 private void TryMove(Vector3 point, Targeter.AttackType attackType)
 {
     //Debug.Log($" unitSelectionHandler.SelectedUnits  try move {unitSelectionHandler.SelectedUnits.Count}");
     foreach (Unit unit in unitSelectionHandler.SelectedUnits)
     {
         //Debug.Log($" unit {unit} to point {point}");
         unit.GetTargeter().CmdSetAttackType(attackType);
         unit.GetUnitMovement().CmdMove(point);
         unit.GetUnitMovement().unitNetworkAnimator.SetTrigger("run");
     }
 }