本文整理汇总了C#中ResourceManager.Load方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceManager.Load方法的具体用法?C# ResourceManager.Load怎么用?C# ResourceManager.Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResourceManager
的用法示例。
在下文中一共展示了ResourceManager.Load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisualEffect
protected VisualEffect(IServiceProvider services, string effectAsset,
int effectLayerCount, IEnumerable<RenderTargetLayerType> requiredRenderTargets)
{
if (services == null)
throw new ArgumentNullException("services");
if (effectAsset == null)
throw new ArgumentNullException("effectAsset");
if (requiredRenderTargets == null)
throw new ArgumentNullException("requiredRenderTargets");
if (effectLayerCount < 0)
throw new ArgumentOutOfRangeException("affectedLayers", "Parameter should have non-negative value.");
renderer = (Renderer)services.GetService(typeof(Renderer));
resourceManager = (ResourceManager)services.GetService(typeof(ResourceManager));
this.requiredRenderTargets = requiredRenderTargets;
this.effectLayerCount = effectLayerCount > 0 ? effectLayerCount : renderer.KBufferManager.Configuration.LayerCount;
effect = resourceManager.Load<Effect>(effectAsset);
effectTechnique = effect.GetTechniqueByName(VisualEffectTechniqueName);
if (!effectTechnique.IsValid)
throw new ArgumentException(
string.Format("Given effect asset '{0}' does not contain technique {1}.", effectAsset, VisualEffectTechniqueName),
"effectAsset");
}
示例2: GameServer
public GameServer()
{
/* Load Resources */
Console.WriteLine("Loading Resources...");
Resources = new ResourceManager();
Resources.Load();
/* Setting Up Server */
Console.WriteLine("Starting Up Server...");
//Package.RecompilePackages();
//CodeManager StartUp = Package.GetPackage(Game.ServerInfo.StartupPackage).CodeManager;
//StartUp.RunMain();
//Game.World.Chunks.ClearWorldGen();
//Game.World.Chunks.AddWorldGens(StartUp.GetWorldGens());
Game.World.ClearWorldGen();
List<WorldGenerator> temp = new List<WorldGenerator>();
temp.Add(new WorldGenerator());
Game.World.AddWorldGen(temp);
/* Listen for Clients */
NetPeerConfiguration Configuration = new NetPeerConfiguration("FantasyScape");
Configuration.Port = 54987;
Configuration.MaximumConnections = 20;
Server = new NetServer(Configuration);
Server.Start();
Message.RegisterServer(Server);
UpdateTimer = new Stopwatch();
UpdateTimer.Start();
Console.WriteLine("Ready!");
}
示例3: Blender
protected Blender(IServiceProvider services, string effectAsset)
{
if (services == null)
throw new ArgumentNullException("services");
if (effectAsset == null)
throw new ArgumentNullException("effectAsset");
resourceManager = (ResourceManager) services.GetService(typeof (ResourceManager));
renderer = (Renderer) services.GetService(typeof (Renderer));
effect = resourceManager.Load<Effect>(effectAsset);
effectTechnique = effect.GetTechniqueByName(BlenderTechniqueName);
}
示例4: DebugDrawer
public DebugDrawer(Backend backend, ResourceManager resourceManager)
{
if (backend == null)
throw new ArgumentNullException("backend");
Backend = backend;
Batch = Backend.CreateBatchBuffer(new Renderer.VertexFormat(new Renderer.VertexFormatElement[]
{
new Renderer.VertexFormatElement(Renderer.VertexFormatSemantic.Position, Renderer.VertexPointerType.Float, 3, 0),
new Renderer.VertexFormatElement(Renderer.VertexFormatSemantic.Color, Renderer.VertexPointerType.Float, 3, sizeof(float) * 3),
new Renderer.VertexFormatElement(Renderer.VertexFormatSemantic.Normal, Renderer.VertexPointerType.Float, 3, sizeof(float) * 6),
}));
Batch.Begin();
Shader = resourceManager.Load<Graphics.Resources.ShaderProgram>("/shaders/physic_debug_drawer");
RenderStateId = backend.CreateRenderState(false, true, true, BlendingFactorSrc.One, BlendingFactorDest.One);
}