Рет қаралды 11,933
In this video we build off of the "How to build your own mod from scratch" video and replace sounds in game. We replace the intro speaker sound with a scooby laugh sound by creating and loading an asset bundle with the stored audio file.
Here's that script I was referring to at the beginning:
```
using UnityEngine;
using UnityEditor;
using System.IO;
public class CreateAssetBundles
{
[MenuItem("Assets/Build AssetBundles")]
static void BuildAllAssetBundles()
{
string assetBundleDirectory = "Assets/StreamingAssets";
if (!Directory.Exists(Application.streamingAssetsPath))
{
Directory.CreateDirectory(assetBundleDirectory);
}
BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);
}
}
```