public void OnSetTarget(TargetPoint target) { if(Target != null) { Target.RemoveLink(); } Target = target; Target.AddLink(); }
// установка новой цели движения public void OnSetTarget(TargetPoint point) { if (targetPoint != null) { targetPoint.DeleteLink(); } if (!TerrainNavGrid.IsPositionCorrect(point.Position)) { return; } StopMove(); targetPoint = point; targetPoint.AddLink(); PathImage = new PathImage(GameParams.Width, GameParams.Length); SetMovePosition(targetPoint.Position); }
public void OnSetTarget(TargetPoint target) { if(Target != null) { Target.RemoveLink(); } Target = target; Target.AddLink(); targetPosition = Target.transform.position; Agent.stoppingDistance = Random.Range(1.0F, 15.0F); }