コード例 #1
0
ファイル: AlignBelowCom.cs プロジェクト: sardap/VFVGAVFAF
        public void Align()
        {
            var ent          = EntityManager.GetEntiy <GameObject>(EntID);
            var postionCom   = ent.GetComponent <IPostionComponet>(PostionAlais);
            var bellowPosCom = ent.GetComponent <IHaveHitBoxCom>(BelowHitboxAlias).HitBox;

            var newPos = postionCom.GetPostion();

            newPos.Y = bellowPosCom.Bottom;

            newPos = Margin.Apply(newPos);

            postionCom.SetPostion(newPos);
        }
コード例 #2
0
ファイル: AlignLeftCom.cs プロジェクト: sardap/VFVGAVFAF
        public void Action()
        {
            var ent        = EntityManager.GetEntiy <GameObject>(EntID);
            var postionCom = ent.GetComponent <IPostionComponet>(PostionAlais);
            var bounds     = ent.GetComponent <IHaveHitBoxCom>(ToAlignLeftOf).HitBox;

            var newPos = postionCom.GetPostion();

            newPos.X = bounds.Right;

            Margin.Apply(newPos);

            postionCom.SetPostion(newPos);
        }