コード例 #1
0
        void FindTarget()
        {
            target = Getter.ObjectWithTag(caller: this,
                                          tag: PersonsTags.Player.ToString(),
                                          errorOnNotFound: Errors.PlayerNotFound
                                          ).transform;

            Vector3 pos = this.transform.position;

            pos.x = target.position.x + offset.x + 3;
            pos.y = target.position.y + offset.y;
            this.transform.position = pos;
        }
コード例 #2
0
        void Awake()
        {
            PositionUtil positionUtil = new PositionUtil();

            GameObject bottomLimitView = Getter.ObjectWithTag(caller: this, tag: ElementiesTags.BottomLimitView.ToString());
            GameObject rightLimitView  = Getter.ObjectWithTag(caller: this, tag: ElementiesTags.RightLimitView.ToString());
            GameObject leftLimitView   = Getter.ObjectWithTag(caller: this, tag: ElementiesTags.LeftLimitView.ToString());

            BoxCollider2D boxCollider2D = (BoxCollider2D)Getter.Component(this, gameObject, typeof(BoxCollider2D));

            Vector2 vector2 = boxCollider2D.size;

            vector2.x = positionUtil.GetHorizontalDistanceBetweenGameObjects(leftLimitView, rightLimitView) + incrementeInHorizontalSize;
            vector2.y = 1;

            boxCollider2D.size = vector2;

            Vector3 thisPosition = this.transform.position;

            thisPosition.x          = positionUtil.GetHorizontalMiddlePointBetweenGameObjects(leftLimitView, rightLimitView);
            thisPosition.y          = bottomLimitView.transform.position.y - distanceBellowFromBottomLimitView;
            this.transform.position = thisPosition;
        }
コード例 #3
0
ファイル: PlayerBase.cs プロジェクト: windahidayatt/cangone
 void SetBottomLimiteToStillAlive()
 {
     bottomLimit = Getter.ObjectWithTag(this, ElementiesTags.BottomLimitView.ToString()).transform.position.y - 7;
 }