Permalink
Browse files

Removing AtomicNET.Cache

  • Loading branch information...
1 parent 1c7fbae commit 99cf8f6c51ad2702899d44e236ae9765b562970d @JoshEngebretson JoshEngebretson committed Oct 21, 2016
@@ -49,7 +49,7 @@ static class Art
public static void Load()
{
- var cache = AtomicNET.Cache;
+ var cache = AtomicNET.GetSubsystem<ResourceCache>();
SpriteSheet2D sheet = cache.GetResource<SpriteSheet2D>("Sprites/AtomicBlasterSprites.xml");
@@ -30,9 +30,10 @@ public override void Start()
renderer.HDRRendering = true;
+ var cache = GetSubsystem<ResourceCache>();
var renderpath = viewport.GetRenderPath().Clone();
- renderpath.Append(AtomicNET.Cache.GetResource<XMLFile>("RenderPath/BloomHDR.xml"));
- renderpath.Append(AtomicNET.Cache.GetResource<XMLFile>("RenderPath/Blur.xml"));
+ renderpath.Append(cache.GetResource<XMLFile>("RenderPath/BloomHDR.xml"));
+ renderpath.Append(cache.GetResource<XMLFile>("RenderPath/Blur.xml"));
viewport.SetRenderPath(renderpath);
Scene = new Scene();
@@ -24,8 +24,9 @@ void Start()
// Create the rendering component + animation controller
AnimatedModel animatedModel = adjustNode.CreateComponent<AnimatedModel>();
- animatedModel.Model = AtomicNET.Cache.GetResource<Model>("Models/Mutant/Mutant.mdl");
- animatedModel.Material = AtomicNET.Cache.GetResource<Material>("Models/Mutant/Materials/mutant_M.material");
+ var cache = GetSubsystem<ResourceCache>();
+ animatedModel.Model = cache.GetResource<Model>("Models/Mutant/Mutant.mdl");
+ animatedModel.Material = cache.GetResource<Material>("Models/Mutant/Materials/mutant_M.material");
animatedModel.CastShadows = true;
// Create animation controller
@@ -30,7 +30,8 @@ public void Start()
halfWidth = graphics.Width * Constants.PIXEL_SIZE * 0.5f;
halfHeight = graphics.Height * Constants.PIXEL_SIZE * 0.5f;
- animationSet = AtomicNET.Cache.GetResource<AnimationSet2D>("Sprites/butterfly.scml");
+ var cache = GetSubsystem<ResourceCache>();
+ animationSet = cache.GetResource<AnimationSet2D>("Sprites/butterfly.scml");
}
speed = 1 + 2.0f * random.Random();
@@ -8,8 +8,9 @@ public void Start()
viewport = AtomicNET.GetSubsystem<Renderer>().GetViewport(0);
- boxSprite = AtomicNET.Cache.GetResource<Sprite2D>("Sprites/Box.png");
- ballSprite = AtomicNET.Cache.GetResource<Sprite2D>("Sprites/Ball.png");
+ var cache = GetSubsystem<ResourceCache>();
+ boxSprite = cache.GetResource<Sprite2D>("Sprites/Box.png");
+ ballSprite = cache.GetResource<Sprite2D>("Sprites/Ball.png");
var ground = Scene.CreateChild("Ground");
@@ -24,7 +25,7 @@ public void Start()
// Set box size
groundShape.Size = new Vector2(0.32f, 0.32f);
// Set friction
- groundShape.Friction = 0.5f;
+ groundShape.Friction = 0.5f;
}
@@ -115,5 +116,3 @@ float Random()
uint spawnCount = 0;
}
-
-

0 comments on commit 99cf8f6

Please sign in to comment.