using System.Collections.Generic; using AtomicEngine; internal static class Cache { private static readonly ResourceCache _cache = AtomicNET.GetSubsystem(); public static T Get(string path) where T : Resource { return _cache.Get(path); } } public class AtomicMain : AppDelegate { private static Scene _scene; private static Terrain _terrain; private Viewport _viewport; private Camera _camera; private Vehicle _vehicle; private Clouds _clouds; public override void Start() { // We setup our scene, main camera and viewport _viewport = GetSubsystem().GetViewport(0); _scene = new Scene(); _scene.CreateComponent().SetSize(new BoundingBox(1,100), 3); _viewport.Scene = _scene; _camera = _scene.CreateChild("Camera").CreateComponent(); _camera.Node.Position = new Vector3(50, 10, -1); _camera.Orthographic = true; _camera.OrthoSize = 26; _viewport.Camera = _camera; // We create a sound source for the music and the music SoundSource musicSource = _scene.CreateComponent(); Sound music = Cache.Get("music/Happy_Bee.ogg"); music.SetLooped(true); musicSource.Play(music); musicSource.SetSoundType("Music"); // We don't need a sound listener for the above, but we add one for the sounds and adjust the music gain Audio audioSystem = GetSubsystem