void SetColliderPosition(TrackPosition tp) { if (tp.GetHeight() == TrackPosition.Height.middle) { checker.center = new Vector3(tp.position.x, 0, tp.position.y); checker.size = Vector3.one * .999f; } else { checker.center = new Vector3(tp.position.x, tp.GetHeight() == TrackPosition.Height.over ? 6.0f : -6.0f, tp.position.y); checker.size = new Vector3(.999f, 10.999f, .999f); } }
List <TrackPosition> AdjacentPositions(TrackPosition pos) { List <TrackPosition> to_ret = new List <TrackPosition>(); to_ret.Add(pos + new Vector2(0, -1)); to_ret.Add(pos + new Vector2(0, 1)); to_ret.Add(pos + new Vector2(-1, 0)); to_ret.Add(pos + new Vector2(1, 0)); if (pos.GetHeight() == TrackPosition.Height.middle) { to_ret.Add(new TrackPosition(pos.position, TrackPosition.Height.over)); to_ret.Add(new TrackPosition(pos.position, TrackPosition.Height.under)); } else { to_ret.Add(new TrackPosition(pos.position, TrackPosition.Height.middle)); } return(to_ret); }