当前位置: 首页>>代码示例>>C#>>正文


C# Bounds.Contains方法代码示例

本文整理汇总了C#中Bounds.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# Bounds.Contains方法的具体用法?C# Bounds.Contains怎么用?C# Bounds.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bounds的用法示例。


在下文中一共展示了Bounds.Contains方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Tile

        public Tile(HeatPointList heatPoints, HeatmapSettings settings, Bounds bounds)
        {
            Bounds = bounds;

            Bounds heatMapBounds = new Bounds(bounds);
            heatMapBounds.TopLeftLat += settings.Size / 2 * this.DegreesPerPixelLat;
            heatMapBounds.TopLeftLng -= settings.Size / 2 * this.DegreesPerPixelLng;
            heatMapBounds.BottomRightLat -= settings.Size / 2 * this.DegreesPerPixelLat;
            heatMapBounds.BottomRightLng += settings.Size / 2 * this.DegreesPerPixelLng;

            HeatPointList pointsWithinBounds = new HeatPointList();
            foreach (HeatPoint hp in heatPoints)
            {
                if (heatMapBounds.Contains(hp)) pointsWithinBounds.Add(hp);
            }

            HeatMap = new HeatMap(pointsWithinBounds, settings, heatMapBounds);
        }
开发者ID:aroder,项目名称:heatmap,代码行数:18,代码来源:Tile.cs

示例2: Update

        public void Update()
        {
            var ml = Game.InputControls.MouseLocation;
            if (!ml.HasValue)
                return;

            var size = Measure();
            var pos = new Vector2(Game.ViewportWidth - size.X, Game.ViewportHeight - size.Y) * new Vector2(0.5f, 0.5f);

            for (int i = 0; i < Items.Count; i++) {
                var item = Items[i];
                var itemSize = item.Measure(Game);
                var itemBounds = new Bounds(
                    pos, pos + itemSize
                );

                if (itemBounds.Contains(ml.Value))
                    SelectedIndex = i;

                pos.Y += itemSize.Y;
            }
        }
开发者ID:kg,项目名称:rlms2013,代码行数:22,代码来源:Menu.cs

示例3: BoundsCanNotContainAPoint

        public void BoundsCanNotContainAPoint()
        {
            b = new Bounds(Vector3.zero, Vector3.one);

            Assert.That(!b.Contains(new Vector3(2, 0, 0)));
        }
开发者ID:Joelone,项目名称:FFWD,代码行数:6,代码来源:WhenCheckingBoundsContainment.cs

示例4: IfAPointIntersectsTheBoundsItWillBeContained

        public void IfAPointIntersectsTheBoundsItWillBeContained()
        {
            b = new Bounds(Vector3.zero, Vector3.one);

            Assert.That(b.Contains(new Vector3(0.5f, 0.5f, 0.5f)));
        }
开发者ID:Joelone,项目名称:FFWD,代码行数:6,代码来源:WhenCheckingBoundsContainment.cs

示例5: BoundsCanContainAPoint

        public void BoundsCanContainAPoint()
        {
            b = new Bounds(Vector3.zero, Vector3.one);

            Assert.That(b.Contains(Vector3.zero));
        }
开发者ID:Joelone,项目名称:FFWD,代码行数:6,代码来源:WhenCheckingBoundsContainment.cs


注:本文中的Bounds.Contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。