{"id":2530,"date":"2019-09-26T10:18:56","date_gmt":"2019-09-26T01:18:56","guid":{"rendered":"https:\/\/blog.criware.com\/?p=2530"},"modified":"2019-09-26T10:18:56","modified_gmt":"2019-09-26T01:18:56","slug":"using-adx2s-in-game-preview-with-unity","status":"publish","type":"post","link":"https:\/\/blog.criware.com\/index.php\/2019\/09\/26\/using-adx2s-in-game-preview-with-unity\/","title":{"rendered":"Using ADX2\u2019s In-Game Preview with Unity"},"content":{"rendered":"<h2 style=\"font-size: 150%; font-weight: bold;\">Introduction<\/h2>\n<p>In-Game Preview is another powerful feature of ADX2 that allows you to preview and edit various audio parameters while your game is running. This is an essential tool for mixing, as it will enable you to hear your sounds playing back in context, under the effects of various gameplay related controls that you may have set up. In this blog, we will have a look at setting this up in Unity for a native PC build. The approach for deploying to various platforms will be slightly different, but still just as intuitive.<\/p>\n<div style=\"max-width: 800px; margin: 0 auto; margin-bottom: 20px;\">\n<div style=\"width: 800px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-2530-1\" width=\"800\" height=\"450\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/2019_09_In-GamePreview-1.mp4?_=1\" \/><a href=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/2019_09_In-GamePreview-1.mp4\">https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/2019_09_In-GamePreview-1.mp4<\/a><\/video><\/div>\n<\/div>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 35px;\">Atom Craft Setup<\/h2>\n<p>To get our Build ready for In-Game Preview, all we need to do is toggle the appropriate option in the Build menu. For testing purposes, I have created a Cue for ambience, fire, and a one-shot click sound.<br \/>\n<img loading=\"lazy\" decoding=\"async\" style=\"\n    display: block;\n    margin: 0 auto;\n    max-width: 700px;\n\" src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-1.png\" alt=\"16-1\" width=\"821\" height=\"710\" class=\"alignnone size-full wp-image-2536\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-1.png 821w, https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-1-300x259.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-1-768x664.png 768w\" sizes=\"auto, (max-width: 821px) 100vw, 821px\" \/><\/p>\n<p>If you are running In-Game Preview for a different platform, or on PC over a network, you can change the settings by right clicking on the relevant Target Config in the Project Tree and selecting \u201cEdit Preview-Settings\u2026\u201d. If running In-Game Preview on the same computer as Atom Craft, the default settings should be fine as is.<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 35px;\">Unity Setup<\/h2>\n<p>In Unity, the setup for In-Game Preview is just as simple. Assuming your project already has the Criware Unity plugin installed with preliminary installation completed, select the <em>CriWareLibraryInitializer<\/em> object in the Scene Hierarchy and tick the \u201cUses In Game Preview\u201d toggle box in the Inspector.<br \/>\n<img loading=\"lazy\" decoding=\"async\" style=\"\n    display: block;\n    margin: 0 auto;\n\"  src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-2.png\" alt=\"16-2\" width=\"1912\" height=\"1040\" class=\"alignnone size-full wp-image-2537\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-2.png 1912w, https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-2-300x163.png 300w, https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-2-768x418.png 768w, https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-2-1024x557.png 1024w\" sizes=\"auto, (max-width: 1912px) 100vw, 1912px\" \/><\/p>\n<p>Next, when linking to the ADX2 build data from within Unity, make sure to direct it to the <em>\/inGamePreivew\/Assets<\/em> folder rather than the root. The files created for In-Game Preview are slightly different, and the regular build data cannot be modified in this way.<\/p>\n<p>Beyond that, all you need are Cues which can be triggered after running In-Game Preview from inside Atom Craft.<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 35px;\">In-Game Preview<\/h2>\n<p>To initiate In-Game Preview, make sure that you have the Atom Craft project which corresponds to the build data inside of Unity open. Then, run the game in Unity and inside Atom Craft select Preview \u2192 Start In-Game Preview, or simply press F10.<\/p>\n<p>A Preview Window should now appear, confirming that a connection has been made. You can verify this further by triggering Cues in your game and watching the level meter inside of Atom Craft.<br \/>\n<img loading=\"lazy\" decoding=\"async\" style=\"\n    display: block;\n    margin: 0 auto;\n\"  src=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-3.png\" alt=\"16-3\" width=\"568\" height=\"293\" class=\"alignnone size-full wp-image-2538\" srcset=\"https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-3.png 568w, https:\/\/blog.criware.com\/wp-content\/uploads\/2019\/09\/16-3-300x155.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/p>\n[TIP] Make sure that you have enough data to make the changes that you want to effect. You can increase the Max Size for the ACF by selecting GlobalSettings in the Project Tree and increasing the size limit in the Inspector. For the ACB, select the relevant Cue Sheet in the WorkUnits Tree and increase the limit in the Inspector. This only affects the size of the data for In-Game Preview and won\u2019t have an impact on your final build.<\/p>\n<h2 style=\"font-size: 150%; font-weight: bold; margin-top: 35px;\">Saving Changes<\/h2>\n<p>Finally, to save your changes, rebuild the project inside Atom Craft and select \u2018Update Assets of \u201cCri Atom Craft\u201d\u2019 inside of the Cri Atom window inside Unity. When you want to switch back to a regular build of the project not intended for In-Game Preview, simply adjust the Assets Path accordingly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In-Game Preview is another powerful feature of ADX2 that allows you to preview and edit various audio parameters while<\/p>\n","protected":false},"author":2,"featured_media":2531,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[5,7],"tags":[],"class_list":["post-2530","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-adx","category-tutorials"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/2530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/comments?post=2530"}],"version-history":[{"count":7,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/2530\/revisions"}],"predecessor-version":[{"id":2543,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/posts\/2530\/revisions\/2543"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media\/2531"}],"wp:attachment":[{"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/media?parent=2530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/categories?post=2530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.criware.com\/index.php\/wp-json\/wp\/v2\/tags?post=2530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}