public override void ToolActionCompleted() { if (_newPath != null) { _newPath.CloseFigure(); } _startPathDraw = true; IsComplete = true; _newPath = null; }
public void DrawPath() { if (team.userTeam) { AIController ai = (AIController)controller; ai.ChangeState(UnitState.USERDRAW); ai.currentDrawn = Vector3.zero; DrawPath path = Instantiate(drawPath) as DrawPath; path.unit = this; } }
/// <summary> /// Return the Trainpath given a pathName. This will load the path if it has not been loaded before. /// </summary> /// <param name="pathName">The name of the path</param> Trainpath TrainpathFromName(string pathName) { Trainpath newTrainpath; if (!loadedPaths.TryGetValue(pathName, out newTrainpath)) { newTrainpath = new Trainpath(trackDB, tsectionDat, fullPathNames[pathName]); loadedPaths[pathName] = newTrainpath; drawPaths[newTrainpath] = new DrawPath(trackDB, tsectionDat); } return(newTrainpath); }
private void TouchStart(float x, float y) { serializablePath = new SerializablePath(); DrawPath newDrawPath = new DrawPath(currentColor, serializablePath); DrawPaths.Add(newDrawPath); serializablePath.MoveToPoint = new Models.Point(x, y); mX = x; mY = y; }
void OnEnable() { drawpathObj = (DrawPath)target; if (drawpathObj == null) { return; } positions = new Vector3[drawpathObj.wplist.Count + 1]; positions[0] = new Vector3(0f, -2.9f, -2.84f); int i = 0; foreach (GameObject wp in drawpathObj.wplist) { positions [++i] = wp.transform.position; } }
public static void DrawWayPointPath(List <Waypoint> waypoints) { waypoints.ForEach(waypoint => { if (waypoint) { waypoint.nextWaypoints.ForEach(nextWayPoint => { if (nextWayPoint) { DrawPath.ForGizmo(waypoint.transform.position, nextWayPoint.transform.position); } }); } }); }
public override void OnMouseDown(DrawArea drawArea, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { ToolActionCompleted(); return; } if (_startPathDraw) { _newPath = new DrawPath(e.X, e.Y); AddNewObject(drawArea, _newPath); _startPathDraw = false; IsComplete = false; } else { _newPath.AddPoint(e.Location); } }
/// <summary> /// Left nouse button is pressed /// </summary> /// <param name="drawArea"></param> /// <param name="e"></param> public override void OnMouseDown(DrawArea drawArea, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { ToolActionCompleted(); return; } // Create new polygon, add it to the list // and keep reference to it if (_startPathDraw) { _newPath = new DrawPath(e.X, e.Y); AddNewObject(drawArea, _newPath); _startPathDraw = false; IsComplete = false; } else { _newPath.AddPoint(e.Location); } }
void Awake() { instance = this; }
void Start() { drawPath = GetComponentInParent <DrawPath>(); }
// Use this for initialization void Start() { spawn = transform.position; gestion = Camera.main.GetComponent<DrawPath>(); gravity = gestion.gravityState; anim = gameObject.GetComponent<AnimationTexture>(); }
// Use this for initialization void Start() { _grid = GetComponent<CreateMap> (); _drawPath = GetComponent<DrawPath> (); }