public List <Point2> GetCanMovePoint(Unit _unit) { List <Point2> standingList = CompornentUtility.FindCompornentOnScene <UnitManager>().GetStandingPoints(); List <Point2> canMovePoints = new List <Point2>(); Point2 pivot = _unit.pos; int moveRange = _unit.GetUnitStatus.moveRange; var crossPoints = StageUtility.GetCrossPoint(pivot, moveRange); foreach (var point in crossPoints) { //既にunitがいた場合continue if (standingList.Contains(point)) { continue; } //たどり着けるかチェック var pathList = pathCreater.GetPath(_unit.pos, point, _unit.GetUnitStatus.stepHeight); if (pathList == null) { continue; } //unitの設定歩数で行けるかチェック if (pathList.Count > moveRange) { continue; } canMovePoints.Add(point); } return(canMovePoints); }
public override List <Point2> Selecting(Unit _user, KeyCode _key) { LightPanelPopper.Instance.AllActiveOff(); List <Point2> returnPoints = new List <Point2>(); var redPoint = RightClickRayShot.GetMouseRayHitObject <BlockPointGetter>(); if (redPoint == null) { return(returnPoints); } var points = StageUtility.GetCrossPoint(redPoint.point, effectRange); foreach (var p in points) { LightPanelPopper.Instance.ActiveOn(p, Color.red); } var pointGetter = RightClickRayShot.GetMouseRayHitObject <BlockPointGetter>(_key); if (pointGetter != null) { returnPoints = StageUtility.GetCrossPoint(pointGetter.point, effectRange); } return(returnPoints); }
public override List <Point2> Selecting(Unit _user, KeyCode _key) { var pointGetter = RightClickRayShot.GetMouseRayHitObject <BlockPointGetter>(_key); if (pointGetter != null) { var crossPoints = StageUtility.GetCrossPoint(pointGetter.point, effectRange); return(crossPoints); } return(null); }