本文整理汇总了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");
}
示例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");
}
示例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();
}
示例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();
}