Ejemplo n.º 1
0
 private void Awake()
 {
     raycaster                = BoxRaycaster.Create(boxCollider, layerMask);
     moveTransform            = !!moveTransform ? moveTransform : transform;
     collisionMoveController  = CollisionMoveController.Create(moveTransform, this);
     collisionMoveHitsFactory = CollisionMoveHitsFactory.Create(boxCollider);
 }
Ejemplo n.º 2
0
        public static BoxRaycaster Create(BoxCollider2D collider, LayerMask layerMask)
        {
            BoxRaycaster instance = CreateInstance <BoxRaycaster>();

            instance.collider = collider;
            Bounds bounds = collider.bounds;

            instance.xEdge = EdgeRaycaster.Create(Vector2.right * bounds.size.x, layerMask);
            instance.yEdge = EdgeRaycaster.Create(Vector2.up * bounds.size.y, layerMask);
            return(instance);
        }