コード例 #1
0
 public bool CanDistanceAttack(UnitCombatSystem unitGridCombat)
 {
     // Number depends on grid tile size
     Debug.Log(Vector3.Distance(GetPosition() / 2, unitGridCombat.GetPosition() / 2));
     Debug.Log($"Range {unitStats.attackRange * 18f / 2}");
     return(Vector3.Distance(GetPosition() / 2f, unitGridCombat.GetPosition() / 2f) <
            (unitStats.attackRange) * 18f / 2);
 }
コード例 #2
0
 public bool CanMeleeAttack(UnitCombatSystem unitGridCombat)
 {
     // Number depends on grid tile size
     return(Vector3.Distance(GetPosition(), unitGridCombat.GetPosition()) < 18f);
 }