Exemple #1
0
        public TransitionState ValidatePlacementTransition(TransitionState transitionState, ref int redo)
        {
            redo = 0;

            if (SpherePath.CheckCell == null)
            {
                return(TransitionState.Collided);
            }

            switch (transitionState)
            {
            case TransitionState.OK:
                SpherePath.CurPos  = SpherePath.CheckPos;
                SpherePath.CurCell = SpherePath.CheckCell;
                SpherePath.CacheGlobalCurrCenter();
                break;

            case TransitionState.Collided:
            case TransitionState.Adjusted:
            case TransitionState.Slid:

                // added target id
                if (SpherePath.PlacementAllowsSliding && ObjectInfo.TargetID == 0)
                {
                    CollisionInfo.Init();
                }

                break;
            }
            return(transitionState);
        }
Exemple #2
0
 void Awake()
 {
     body = GetComponent <BoxCollider2D>();
     collisionInfo.Init(this);
 }