// public enum UnitMove{ // Walk, //Drone, Walker // Wheel, //Wheeled // Thread, //Track // Swim, //Boat // Dive, //Sub // Float, //Hover, HoverDrone // Balloon, //Heli // Fly //Jet // }; void Start() { PathRenderer = (PathShow)transform.FindChild("PathIcon").gameObject.GetComponent("PathShow"); grid = GameObject.Find("Grid"); Highlight = this.transform.FindChild("Highlight").gameObject; CursorHighlight = this.transform.FindChild("TileCursorHighlight").gameObject; }
public void renderPath() { int routeSize = movementPattern.Count; if (routeSize > 0) { Vector2 coord; OriginDirection d; PathShow pathRenderer = TilesSpec.getTileSpec(originx, originy).PathRenderer; pathRenderer.Type = PathShow.PathType.Origin; for (int i = 0; i < routeSize; i++) { coord = (Vector2)movementPattern [i]; d = direction[(int)coord.x, (int)coord.y]; switch (d) { case OriginDirection.N: pathRenderer.Next = OriginDirection.S; break; case OriginDirection.S: pathRenderer.Next = OriginDirection.N; break; case OriginDirection.E: pathRenderer.Next = OriginDirection.W; break; case OriginDirection.W: pathRenderer.Next = OriginDirection.E; break; } pathRenderer.ShowPath(); pathRenderer = TilesSpec.getTileSpec((int)coord.x, (int)coord.y).PathRenderer; pathRenderer.Prev = direction[(int)coord.x, (int)coord.y]; if (i >= routeSize - 1) { pathRenderer.Type = PathShow.PathType.Target; } else { pathRenderer.Type = PathShow.PathType.Path; } } pathRenderer.ShowPath(); } }