protected override void Start() { scene = new Scene(); scene.LoadXml(ResourceCache.GetFile(Assets.Scenes.Room, true)); cameraNode = scene.CreateChild(); camera = cameraNode.CreateComponent<Camera>(); cameraNode.Position = new Vector3(15.0f, 10.0f, 0.0f); camera.Fov = 70.0f; Node weaponNode = cameraNode.CreateChild(); weaponNode.SetScale(0.1f); weaponNode.Position = new Vector3(0.7f, -1.3f, 1.2f); StaticModel weaponObject = weaponNode.CreateComponent<StaticModel>(); weaponObject.Model = ResourceCache.GetModel(Assets.Models.Weapon); weaponObject.ApplyMaterialList(""); Viewport viewport = new Viewport(scene, camera, null); viewport.RenderPath.Append(CoreAssets.PostProcess.FXAA2); Renderer.SetViewport(0, viewport); // Subscribe to Esc key: Input.SubscribeToKeyDown(args => { if (args.Key == Key.Esc) Exit(); }); isMobile = Platform == Platforms.Android || Platform == Platforms.iOS; //if (isMobile) { // Add joystick var layout = ResourceCache.GetXmlFile(Assets.UI.ScreenJoystick_Samples); var screenJoystickIndex = Input.AddScreenJoystick(layout, ResourceCache.GetXmlFile(Assets.UI.DefaultStyle)); Input.SetScreenJoystickVisible(screenJoystickIndex, true); } }
public override void ApplyMaterial(StaticModel model) { model.ApplyMaterialList(materialListPath); }