예제 #1
0
        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
        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);
        }