public void getDirectionsToTargets(out PathChecker.PathDirection direction1, out PathChecker.PathDirection direction2) { getDirectionToTarget(targetRepere1, out direction1); if (targetRepere2 == null) { direction2 = direction1; } else { getDirectionToTarget(targetRepere2, out direction2); } }
private void getDirectionToTarget(RepereType repere, out PathChecker.PathDirection direction) { if (repere == ReperesManager.Instance.repereBas) { direction = PathChecker.PathDirection.Down; } else if (repere == ReperesManager.Instance.repereHaut) { direction = PathChecker.PathDirection.Up; } else if (repere == ReperesManager.Instance.repereGauche) { direction = PathChecker.PathDirection.Left; } else { direction = PathChecker.PathDirection.Right; } }