Browse Source

fix case sensitivity for Resources

JimMarlowe 9 years ago
parent
commit
be95af005b

+ 10 - 10
Racer2D/CSharp/Resources/Scripts/AtomicMain.cs

@@ -36,7 +36,7 @@ public class AtomicMain : AppDelegate
 
         // We create a sound source for the music and the music
         SoundSource musicSource = _scene.CreateComponent<SoundSource>();
-        Sound music = Cache.Get<Sound>("music/Happy_Bee.ogg");
+        Sound music = Cache.Get<Sound>("Music/Happy_Bee.ogg");
         music.SetLooped(true);
         musicSource.Play(music);
         musicSource.SetSoundType("Music");
@@ -49,7 +49,7 @@ public class AtomicMain : AppDelegate
         // We create a background node which is a child of the camera so it won't move relative to it
         Node bg = _camera.Node.CreateChild("Background");
         StaticSprite2D bgspr = bg.CreateComponent<StaticSprite2D>();
-        bgspr.SetSprite(Cache.Get<Sprite2D>("scenarios/grasslands/bg.png"));
+        bgspr.SetSprite(Cache.Get<Sprite2D>("Scenarios/grasslands/BG.png"));
         bg.SetPosition(new Vector3(0,0,100));
         bg.SetScale2D(Vector2.One*5.2f);
         
@@ -89,26 +89,26 @@ public class AtomicMain : AppDelegate
     // Convenience function to create node with sprite and rigidbody (optional)
     static Vehicle CreateVehicle(Vector2 position)
     {
-        Node vehicleNode = CreateSpriteNode(Cache.Get<Sprite2D>("characters/truck/vehicle.png"), 1.4f);
+        Node vehicleNode = CreateSpriteNode(Cache.Get<Sprite2D>("Characters/truck/vehicle.png"), 1.4f);
 
         // We create the vehicle and the chassis (CreateChassis returns the Vehicle for convenience)
         Vehicle vehicle = vehicleNode.CreateComponent<Vehicle>().CreateChassis(
             new Vector2(-0.1f, 0.4f), 1.4f, 5,
-            new Vector3(-2f, -1, 1), Cache.Get<ParticleEffect2D>("particles/smoke.pex"),
-            Cache.Get<Sound>("sounds/engine_sound_crop.wav"), Cache.Get<Sound>("sounds/tires_squal_loop.wav"),
-            new [] {Cache.Get<Sound>("sounds/susp_1.wav"), Cache.Get<Sound>("sounds/susp_3.wav")},
+            new Vector3(-2f, -1, 1), Cache.Get<ParticleEffect2D>("Particles/smoke.pex"),
+            Cache.Get<Sound>("Sounds/engine_sound_crop.wav"), Cache.Get<Sound>("Sounds/tires_squal_loop.wav"),
+            new [] {Cache.Get<Sound>("Sounds/susp_1.wav"), Cache.Get<Sound>("Sounds/susp_3.wav")},
             300, 50, 5, 500);
 
         // We create the wheels
-        Sprite2D wspr = Cache.Get<Sprite2D>("characters/truck/wheel.png");
+        Sprite2D wspr = Cache.Get<Sprite2D>("Characters/truck/wheel.png");
         Node w1 = vehicle.CreateWheel(
-            wspr, new Vector2(1.5f,-1.5f), 1.25f, 4, 0.4f, Cache.Get<ParticleEffect2D>("particles/dust.pex"), 2.6f);
+            wspr, new Vector2(1.5f,-1.5f), 1.25f, 4, 0.4f, Cache.Get<ParticleEffect2D>("Particles/dust.pex"), 2.6f);
         Node w2 = vehicle.CreateWheel(
-            wspr, new Vector2(-1.8f,-1.5f), 1.25f, 4, 0.4f, Cache.Get<ParticleEffect2D>("particles/dust.pex"), 2.6f);
+            wspr, new Vector2(-1.8f,-1.5f), 1.25f, 4, 0.4f, Cache.Get<ParticleEffect2D>("Particles/dust.pex"), 2.6f);
 
         // We create the head
         Node head = vehicle.CreateHead(
-            Cache.Get<Sprite2D>("characters/truck/head.png"), new Vector3(-1,2.7f,-1), 1f, new Vector2(-1,1.8f));
+            Cache.Get<Sprite2D>("Characters/truck/head.png"), new Vector3(-1,2.7f,-1), 1f, new Vector2(-1,1.8f));
 
         // We position the vehicle
         foreach (Node node in new []{vehicleNode, w1, w2, head})

+ 4 - 4
Racer2D/CSharp/Resources/Scripts/Clouds.cs

@@ -17,9 +17,9 @@ public class Clouds
         _range = range;
 
         Sprite2D[] cloudSprites = {
-            Cache.Get<Sprite2D>("scenarios/cloud1.png"),
-            Cache.Get<Sprite2D>("scenarios/cloud2.png"),
-            Cache.Get<Sprite2D>("scenarios/cloud3.png")};
+            Cache.Get<Sprite2D>("Scenarios/cloud1.png"),
+            Cache.Get<Sprite2D>("Scenarios/cloud2.png"),
+            Cache.Get<Sprite2D>("Scenarios/cloud3.png")};
 
         // We pre-fill the screen with clouds
         float cloudSpacing = range*2/amount;
@@ -53,4 +53,4 @@ public class Clouds
             cloud.Translate2D(-Vector2.UnitX*dt*((cloud.Position2D.Y-_minY)*0.3f+1));
         }
     }
-}
+}

+ 6 - 6
Racer2D/CSharp/Resources/Scripts/Terrain.cs

@@ -64,13 +64,13 @@ public class Terrain
         _scene = scene;
 
         // We load the materials, the ones in this example only use built in techniques, we use diffuse for the ground for performance
-        _surfaceMaterial = Cache.Get<Material>("materials/UnlitAlpha.xml");
-        _surfaceMaterial.SetTexture(0, Cache.Get<Texture2D>("scenarios/grasslands/surface.png"));
-        _chunkMaterial = Cache.Get<Material>("materials/Unlit.xml");
-        _chunkMaterial.SetTexture(0,Cache.Get<Texture2D>("scenarios/grasslands/ground.png"));
+        _surfaceMaterial = Cache.Get<Material>("Materials/UnlitAlpha.xml");
+        _surfaceMaterial.SetTexture(0, Cache.Get<Texture2D>("Scenarios/grasslands/surface.png"));
+        _chunkMaterial = Cache.Get<Material>("Materials/Unlit.xml");
+        _chunkMaterial.SetTexture(0,Cache.Get<Texture2D>("Scenarios/grasslands/ground.png"));
 
         // We create and populate a library with the decorations
-        Func<string, Sprite2D> GetSprite = file => Cache.Get<Sprite2D>($"scenarios/grasslands/Object/{file}");
+        Func<string, Sprite2D> GetSprite = file => Cache.Get<Sprite2D>($"Scenarios/grasslands/Object/{file}");
         _decorationLib = new DecorationLibrary<Sprite2D>(
             new [] {GetSprite("Bush (1).png"), GetSprite("Bush (2).png"), GetSprite("Bush (3).png"), GetSprite("Bush (4).png")}, 
             new [] {GetSprite("Mushroom_1.png"), GetSprite("Mushroom_2.png"), GetSprite("Stone.png"), GetSprite("Sign_2.png")}, 
@@ -84,7 +84,7 @@ public class Terrain
         }
 
         // We generate the chunks and add some boxes randomly
-        Sprite2D crateSprite = Cache.Get<Sprite2D>("scenarios/grasslands/Object/Crate.png");
+        Sprite2D crateSprite = Cache.Get<Sprite2D>("Scenarios/grasslands/Object/Crate.png");
         for (int i = 0; i < Chunksize*chunksToGenerate; i+=Chunksize)
         {
             GenerateChunk(i);