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


C# IAssetManager.Get方法代码示例

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


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

示例1: MyGameWorld

        public MyGameWorld(
            I2DRenderUtilities renderUtilities,
            IAssetManagerProvider assetManagerProvider,
            IEntityFactory entityFactory)
        {
            this.Entities = new List<IEntity>();

            _renderUtilities = renderUtilities;
            _assetManager = assetManagerProvider.GetAssetManager();
            _defaultFont = this._assetManager.Get<FontAsset>("font.Default");

            // You can also save the entity factory in a field and use it, e.g. in the Update
            // loop or anywhere else in your game.
            var entityA = entityFactory.CreateExampleEntity("EntityA");
            entityA.X = 100;
            entityA.Y = 50;
            var entityB = entityFactory.CreateExampleEntity("EntityB");
            entityB.X = 120;
            entityB.Y = 100;

            // Don't forget to add your entities to the world!
            this.Entities.Add(entityA);
            this.Entities.Add(entityB);

            // This pulls in the texture asset via the asset manager.  Note that
            // the folder seperator from "texture/Player" has been translated
            // into a single dot.
            _playerTexture = _assetManager.Get<TextureAsset>("texture.Player");
        }
开发者ID:hach-que,项目名称:Protogame.Docs,代码行数:29,代码来源:referencing_an_asset_full_code.cs

示例2: BoardRendererEntity

 public BoardRendererEntity(
     BoardAnalyzerEntity analyzerEntity,
     WebcamEntity webcamEntity, 
     IGraphicsBlit graphicsBlit, 
     IAssetManager assetManager,
     TextBox alphaTextBox)
 {
     _analyzerEntity = analyzerEntity;
     _webcamEntity = webcamEntity;
     _graphicsBlit = graphicsBlit;
     _alphaTextBox = alphaTextBox;
     _warpFromPolygonEffect = assetManager.Get<EffectAsset>("effect.WarpFromPolygon");
 }
开发者ID:hach-que,项目名称:Augmented-Board-Game,代码行数:13,代码来源:BoardRendererEntity.cs

示例3: DetectorEntity

        public DetectorEntity(WebcamEntity webcamEntity, IAssetManager assetManager, I2DRenderUtilities renderUtilities)
        {
            _webcamEntity = webcamEntity;
            _assetManager = assetManager;
            _renderUtilities = renderUtilities;
            _defaultFont = _assetManager.Get<FontAsset>("font.Default");

            _colorsToDetect = new List<ColorToDetect>
            {
                new ColorToDetect {Color = new Color(1f, 0f, 0f), Name = "Red"},
                new ColorToDetect {Color = new Color(0f, 1f, 0f), Name = "Green"},
                new ColorToDetect {Color = new Color(0f, 0f, 1f), Name = "Blue"},
                new ColorToDetect {Color = new Color(1f, 1f, 0f), Name = "Yellow"}
            };

            _currentIndex = 0;
            _currentColor = _colorsToDetect[_currentIndex];

            GlobalSensitivity = 1/10000000f*25f;

            _thread = new Thread(ProcessorThread);
            _thread.IsBackground = true;
            _thread.Start();
        }
开发者ID:hach-que,项目名称:Augmented-Board-Game,代码行数:24,代码来源:DetectorEntity.cs

示例4: BoardAnalyzerEntity

        public BoardAnalyzerEntity(
            DetectorEntity detectorEntity, 
            TextBox pointThresholdTextBox, 
            TextBox minNumberOfPointsTextBox, 
            TextBox maxNumberOfPointsTextBox, 
            I2DRenderUtilities renderUtilities,
            IAssetManager assetManager)
        {
            _detectorEntity = detectorEntity;
            _pointThresholdTextBox = pointThresholdTextBox;
            _minNumberOfPointsTextBox = minNumberOfPointsTextBox;
            _maxNumberOfPointsTextBox = maxNumberOfPointsTextBox;
            _renderUtilities = renderUtilities;

            _pointThresholdTextBox.Text = _pointThreshold.ToString();
            _minNumberOfPointsTextBox.Text = _minNumberOfPoints.ToString();
            _maxNumberOfPointsTextBox.Text = _maxNumberOfPoints.ToString();

            _defaultFont = assetManager.Get<FontAsset>("font.Default");

            _thread = new Thread(Run);
            _thread.IsBackground = true;
            _thread.Start();
        }
开发者ID:hach-que,项目名称:Augmented-Board-Game,代码行数:24,代码来源:BoardAnalyzerEntity.cs


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