Created
January 16, 2023 07:57
-
-
Save wotakuro/abbf795ec9f8397daddd34f35535fc1d to your computer and use it in GitHub Desktop.
StreamingAssetsをプラットフォームごとに分ける
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor.Build; | |
using UnityEditor; | |
public class StreamingAssetsDynamicTest : BuildPlayerProcessor | |
{ | |
public override void PrepareForBuild(BuildPlayerContext buildPlayerContext) | |
{ | |
var buildTarget = buildPlayerContext.BuildPlayerOptions.target; | |
switch (buildTarget) { | |
case BuildTarget.StandaloneWindows: | |
buildPlayerContext.AddAdditionalPathToStreamingAssets("AssetBundles/Windows"); | |
break; | |
case BuildTarget.Android: | |
buildPlayerContext.AddAdditionalPathToStreamingAssets("AssetBundles/Android"); | |
break; | |
case BuildTarget.iOS: | |
buildPlayerContext.AddAdditionalPathToStreamingAssets("AssetBundles/iOS"); | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment