Ejemplo n.º 1
0
        private void UpdatePositionInitial()
        {
            initial_press_position = current_press_position;

            world_press_target =
                Physics2DExtensions.OverlapCircleAll(initial_press_position, world_press_system.GetPressRadius(), world_press_system.GetTargetLayers())
                .Narrow(c => c.HasComponentUpward <IWorldPressTarget>())
                .Convert(c => c.gameObject)
                .FindRolling(
                    new RollingCriteria <GameObject>(RollingCriteriaTarget.Larger, g => g.GetSortingLayer().IfNotNull(l => l.GetValue())),
                    new RollingCriteria <GameObject>(RollingCriteriaTarget.Smaller, g => g.GetPlanarSize().GetMinComponent())
                    )
                .IfNotNull(z => z.GetComponentUpward <IWorldPressTarget>());

            touch_point = CreateRelativePointFromWorldPoint(GetCurrentPressPosition());
            world_press_target.IfNotNull(t => t.Touch(this));

            timer.Restart();
        }
Ejemplo n.º 2
0
 public IEnumerable <PathNode2D> GetPathNodes(Vector2 position, float radius)
 {
     return(Physics2DExtensions.OverlapCircleAll(position, radius + connection_fudge_distance, node_layer)
            .ConvertComponent <Collider2D, PathNode2D>());
 }