コード例 #1
0
 void Awake()
 {
     sprite        = transform.FindChild("sprite").gameObject;
     explosion     = transform.FindChild("explosion").gameObject;
     bomb_collider = GetComponent <CircleCollider2D>();
     circle_drawer = GetComponent <CircleDraw>();
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public bool IsContain(RectangleF mouseRect, DirectiveDraw entity)
        {
            CircleDraw circle = entity as CircleDraw;

            return(Geometry.RectContainCircle(mouseRect, circle.centerPosition, circle.radius));
        }
コード例 #5
0
        public bool IsHitting(PointF mouseLocationInModel, DirectiveDraw entity)
        {
            CircleDraw circle = entity as CircleDraw;

            return(Geometry.PointInCircle(mouseLocationInModel, circle.centerPosition, circle.radius, circle.lineWidth));
        }
コード例 #6
0
ファイル: Shell.cs プロジェクト: SavvyEdu/Atom
 private void Awake()
 {
     particles  = new List <Particle>();
     circleDraw = GetComponent <CircleDraw>();
 }
コード例 #7
0
ファイル: Map.cs プロジェクト: watermelonade/isometric-wars
    public void ShowPlayerRange(float range, Vector3 pos)
    {
        circle = gameObject.AddComponent<CircleDraw>();

        circle.MakeCircle(range, pos);
    }
コード例 #8
0
ファイル: Target.cs プロジェクト: UserNameIsAlredyTaken/Boids
 private void Awake()
 {
     _circleDraw = GetComponent <CircleDraw>();
     hauseTarget = GetComponent <Base>() != null;
 }