void Awake() { sprite = transform.FindChild("sprite").gameObject; explosion = transform.FindChild("explosion").gameObject; bomb_collider = GetComponent <CircleCollider2D>(); circle_drawer = GetComponent <CircleDraw>(); }
protected override void SetTrack(PointF ModelOrigin, Color backColor) { PointF canvasOrgion = DrawingUtils.Instance.CoordinateTrans(ModelOrigin); this.circle = new CircleDraw(new PointF(canvasOrgion.X + centerPosition.X, canvasOrgion.Y + centerPosition.Y), radius, Properties.Settings.Default.TrackWidth, backColor); this.centerPosition = new PointF(canvasOrgion.X + centerPosition.X, canvasOrgion.Y + centerPosition.Y); }
protected override void SetTrack(PointF ModelOrigin, Color backColor) { PointF canvasOrigin = DrawingUtils.Instance.CoordinateTrans(ModelOrigin); PointF position = new PointF(this.position.X + canvasOrigin.X, this.position.Y + canvasOrigin.Y); this.circle = new CircleDraw(new PointF(position.X, position.Y), Properties.Settings.Default.TrackWidth, Properties.Settings.Default.TrackWidth * 0.25f, backColor); this.upLine = new LineDraw(new PointF(position.X, position.Y + Properties.Settings.Default.TrackWidth * 0.5f), new PointF(position.X, position.Y + Properties.Settings.Default.TrackWidth * (float)1.2), Properties.Settings.Default.TrackWidth * 0.12f, backColor, false, true); this.downLine = new LineDraw(new PointF(position.X, position.Y - Properties.Settings.Default.TrackWidth * 0.5f), new PointF(position.X, position.Y - Properties.Settings.Default.TrackWidth * (float)1.2), Properties.Settings.Default.TrackWidth * 0.12f, backColor, false, true); this.leftLine = new LineDraw(new PointF(position.X - Properties.Settings.Default.TrackWidth * 0.5f, position.Y), new PointF(position.X - Properties.Settings.Default.TrackWidth * (float)1.2, position.Y), Properties.Settings.Default.TrackWidth * 0.12f, backColor, false, true); this.rightLine = new LineDraw(new PointF(position.X + Properties.Settings.Default.TrackWidth * 0.5f, position.Y), new PointF(position.X + Properties.Settings.Default.TrackWidth * (float)1.2, position.Y), Properties.Settings.Default.TrackWidth * 0.12f, backColor, false, true); }
public bool IsContain(RectangleF mouseRect, DirectiveDraw entity) { CircleDraw circle = entity as CircleDraw; return(Geometry.RectContainCircle(mouseRect, circle.centerPosition, circle.radius)); }
public bool IsHitting(PointF mouseLocationInModel, DirectiveDraw entity) { CircleDraw circle = entity as CircleDraw; return(Geometry.PointInCircle(mouseLocationInModel, circle.centerPosition, circle.radius, circle.lineWidth)); }
private void Awake() { particles = new List <Particle>(); circleDraw = GetComponent <CircleDraw>(); }
public void ShowPlayerRange(float range, Vector3 pos) { circle = gameObject.AddComponent<CircleDraw>(); circle.MakeCircle(range, pos); }
private void Awake() { _circleDraw = GetComponent <CircleDraw>(); hauseTarget = GetComponent <Base>() != null; }