Browse Source

Removing AtomicNET.Cache

Josh Engebretson 9 years ago
parent
commit
99cf8f6c51

+ 1 - 1
AtomicBlaster/CSharp/Resources/Scripts/Art.cs

@@ -49,7 +49,7 @@ namespace AtomicBlaster
 
         public static void Load()
         {
-            var cache = AtomicNET.Cache;
+            var cache = AtomicNET.GetSubsystem<ResourceCache>();
 
             SpriteSheet2D sheet = cache.GetResource<SpriteSheet2D>("Sprites/AtomicBlasterSprites.xml");
 

+ 3 - 2
AtomicBlaster/CSharp/Resources/Scripts/GameRoot.cs

@@ -30,9 +30,10 @@ namespace AtomicBlaster
 
             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();

+ 3 - 2
AtomicMutant/CSharp/Resources/Components/CharacterExample.cs

@@ -24,8 +24,9 @@ public class CharacterExample : CSComponent
         // 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

+ 2 - 1
Butterflies/CSharp/Resources/Components/Butterfly.cs

@@ -30,7 +30,8 @@ public class Butterfly : CSComponent
             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();

+ 4 - 5
Physics2D/CSharp/Resources/Components/PhysicsSpawner.cs

@@ -8,8 +8,9 @@ public class PhysicsSpawner : CSComponent
 
         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 class PhysicsSpawner : CSComponent
         // 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 @@ public class PhysicsSpawner : CSComponent
     uint spawnCount = 0;
 
 }
-
-