SlideShare ist ein Scribd-Unternehmen logo
1 von 69
Downloaden Sie, um offline zu lesen






問題を解決するときはいつも、もっとも抵抗の少
ない道を選んで行けばたやすく解決しそうに見え
る。 しかして、その易しそうな道こそが最も過酷
で残酷なものに変質するのだ…
-Winston Churchill
•
•
•
•
•
•
•
•
•
•
Unityプロジェクト 開発初週 - 直接参照
public class spawnCarFromDirectReference : MonoBehaviour
{
public GameObject carPrefab;
void Start ()
{
if(carPrefab != null)
GameObject.Instantiate(carPrefab, this.transform, false);
}
}
Unityプロジェクト,開発2週目 - Resources.Load
public class spawnCarFromResources : MonoBehaviour
{
public string carName;
void Start ()
{
var go = Resources.Load<GameObject>(carName);
if(go != null)
GameObject.Instantiate(go, this.transform, false);
}
}
Unityプロジェクト,開発3週目 - Resources.LoadAsync
public class spawnCarFromResourcesAsync : MonoBehaviour
{
public string carName;
IEnumerator Start ()
{
var req = Resources.LoadAsync(carName);
yield return req;
if(req.asset != null)
GameObject.Instantiate(req.asset, this.transform, false);
}
}
そして3ヶ月の時が流れた ...
Resourcesからアセットバンドルへの変更
public class MyBuildProcess
{
...
[MenuItem("Build/Build Asset Bundles")]
public static void BuildAssetBundles()
{
var outputPath = bundleBuildPath;
if(!Directory.Exists(outputPath))
Directory.CreateDirectory(outputPath);
var manifest = BuildPipeline.BuildAssetBundles(outputPath,
BuildAssetBundleOptions.ChunkBasedCompression,
EditorUserBuildSettings.activeBuildTarget);
var bundlesToCopy = new List<string>(manifest.GetAllAssetBundles());
// Copy the manifest file
bundlesToCopy.Add(EditorUserBuildSettings.activeBuildTarget.ToString());
CopyBundlesToStreamingAssets(bundlesToCopy);
}
...
}
Resourcesからアセットバンドルへの変更
public class spawnCarFromBuiltinAssetBundle : MonoBehaviour
{
public string carName;
public string carBundleName;
IEnumerator Start ()
{
if(!string.IsNullOrEmpty(carBundleName))
{
var bundleReq = AssetBundle.LoadFromFileAsync(carBundleName);
yield return bundleReq;
var bundle = bundleReq.assetBundle;
if( bundle != null)
{
var assetReq = bundle.LoadAssetAsync(carName);
yield return assetReq;
if(assetReq.asset != null)
GameObject.Instantiate(assetReq.asset, this.transform,
false);
}
}
}
}
そして3ヶ月後 ...
Asset BundlesをCDNからロードするよう書き換え
public class spawnCarFromRemoteAssetBundle : MonoBehaviour
{
public string carName;
public string carBundleName;
public string remoteUrl;
IEnumerator Start ()
{
var bundleUrl = Path.Combine(remoteUrl, carBundleName);
var webReq = UnityWebRequest.GetAssetBundle(bundleUrl);
var handler = webReq.downloadHandler as DownloadHandlerAssetBundle;
yield return webReq.Send();
var bundle = handler.assetBundle;
if(bundle != null)
{
var prefab = bundle.LoadAsset<GameObject>(carName);
if(prefab != null)
GameObject.Instantiate(prefab, this.transform, false);
}
}
}
Loading Asset Bundles from CDN
public class spawnCarFromRemoteAssetBundle : MonoBehaviour
{
public string carName;
public string carBundleName;
public string remoteUrl;
IEnumerator Start ()
{
var bundleUrl = Path.Combine(remoteUrl, carBundleName);
var webReq = UnityWebRequest.GetAssetBundle(bundleUrl);
var handler = webReq.downloadHandler as DownloadHandlerAssetBundle;
yield return webReq.Send();
var bundle = handler.assetBundle;
if(bundle != null)
{
var prefab = bundle.LoadAsset<GameObject>(carName);
if(prefab != null)
GameObject.Instantiate(prefab, this.transform, false);
}
}
}
こ
ん
な
コ
ー
ド
じ
ゃ
無
理
!
!
public class spawnCarFromRemoteAssetBundleWithDependencies : MonoBehaviour
{
// Simple class to handle loading asset bundles via UnityWebRequest
public class AssetBundleLoader
{
string uri;
string bundleName;
public AssetBundle assetBundle
{
get; private set;
}
public static AssetBundleLoader Factory(string uri, string bundleName)
{
return new AssetBundleLoader(uri, bundleName);
}
private AssetBundleLoader(string uri, string bundleName)
{
this.uri = uri;
this.bundleName = bundleName;
}
public IEnumerator Load()
{
var bundleUrl = Path.Combine(this.uri, this.bundleName);
var webReq = UnityWebRequest.GetAssetBundle(bundleUrl);
var handler = webReq.downloadHandler as
DownloadHandlerAssetBundle;
yield return webReq.Send();
assetBundle = handler.assetBundle;
}
}
public string carName;
public string carBundleName;
public string manifestName;
public string remoteUrl;
IEnumerator Start ()
{
var manifestLoader = AssetBundleLoader.Factory(remoteUrl,
bundleManifestName);
yield return manifestLoader.Load();
var manifestBundle = manifestLoader.assetBundle;
// Bail out if we can't load the manifest
if(manifestBundle == null)
{
Debug.LogWarning("Could not load asset bundle manifest.");
yield break;
}
var op =
manifestBundle.LoadAssetAsync<AssetBundleManifest>("AssetBundleManifest");
yield return op;
var manifest = op.asset as AssetBundleManifest;
var deps = manifest.GetAllDependencies(carBundleName);
foreach(var dep in deps)
{
Debug.LogFormat("Loading asset bundle dependency {0}", dep);
var loader = AssetBundleLoader.Factory(remoteUrl, dep);
yield return loader.Load();
}
var carLoader = AssetBundleLoader.Factory(remoteUrl, carBundleName);
yield return carLoader.Load();
if(carLoader.assetBundle != null)
{
op = carLoader.assetBundle.LoadAssetAsync<GameObject>(carName);
yield return op;
var prefab = op.asset as GameObject;
if(prefab != null)
GameObject.Instantiate(prefab, this.transform, false);
}
}
}
さらに求められる、アセットバンドルに必要な配慮:
• 一番効率的にアセットをバンドルに含める方法
• バンドル内のアセット重複回避
• バンドルに含まれているアセットの管理・確認
• バンドルのロードのメモリ管理


• 

•


•
•
•
•
•
•
•
T


- heszkeWmeszke
•
•
•
•
•
•
•
•
•
•
•
•
•
• 

•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Unity 2017.1b (experimental)
https://github.com/Unity-Technologies/AssetBundles-BuildPipeline
UnityEditor.Experimental.Build.AssetBundle

Bundle Build Pipeline Overhaul Sneak Peak
public static AssetBundleBuildInput
GenerateAssetBundleBuildInput(
AssetBundleBuildSettings settings) { … }
public struct AssetBundleBuildInput
{
public struct Definition
{
public string name;
public string variant;
public GUID[] assets;
}
public AssetBundleBuildSettings settings;
public Definition[] bundles;
}
* Input generated from asset importer meta
data or any other source (external tools, etc.)


Bundle Build Pipeline Overhaul Sneak Peak
public static AssetBundleBuildCommandSet
GenerateAssetBuildCommandSet(
AssetBundleBuildInput buildInput) { … }
public struct AssetBundleBuildCommandSet
{
public struct Command
{
public AssetBundleBuildInput.Definition input;
public ObjectIdentifier[] objectsToBeWritten;
}
public AssetBundleBuildSettings settings;
public Command[] commands;
}
Command set generation gathers all
dependencies, handles object stripping, and
generates full list of objects to write.


Bundle Build Pipeline Overhaul Sneak Peak
public static void SaveAssetBundleOutput(AssetBundleBuildOutput output) { … }
Output can be serialized to JSON or any other
format as required.
Bundle Build Pipeline Overhaul Sneak Peak
public static void SaveAssetBundleOutput(AssetBundleBuildOutput output) { … }
Put it all together …
// Default build pipeline
SaveAssetBundleOutput(ExecuteAssetBuildCommandSet(GenerateAssetBuildComma
ndSet(GenerateAssetBundleBuildInput(settings))));

Unity 2017.1b
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
public class spawnCarFromRemoteAssetBundleWithDependencies : MonoBehaviour
{
// Simple class to handle loading asset bundles via UnityWebRequest
public class AssetBundleLoader
{
string uri;
string bundleName;
public AssetBundle assetBundle
{
get; private set;
}
public static AssetBundleLoader Factory(string uri, string bundleName)
{
return new AssetBundleLoader(uri, bundleName);
}
private AssetBundleLoader(string uri, string bundleName)
{
this.uri = uri;
this.bundleName = bundleName;
}
public IEnumerator Load()
{
var bundleUrl = Path.Combine(this.uri, this.bundleName);
var webReq = UnityWebRequest.GetAssetBundle(bundleUrl);
var handler = webReq.downloadHandler as
DownloadHandlerAssetBundle;
yield return webReq.Send();
assetBundle = handler.assetBundle;
}
}
public string carName;
public string carBundleName;
public string manifestName;
public string remoteUrl;
IEnumerator Start ()
{
var manifestLoader = AssetBundleLoader.Factory(remoteUrl,
bundleManifestName);
yield return manifestLoader.Load();
var manifestBundle = manifestLoader.assetBundle;
// Bail out if we can't load the manifest
if(manifestBundle == null)
{
Debug.LogWarning("Could not load asset bundle manifest.");
yield break;
}
var op =
manifestBundle.LoadAssetAsync<AssetBundleManifest>("AssetBundleManifest");
yield return op;
var manifest = op.asset as AssetBundleManifest;
var deps = manifest.GetAllDependencies(carBundleName);
foreach(var dep in deps)
{
Debug.LogFormat("Loading asset bundle dependency {0}", dep);
var loader = AssetBundleLoader.Factory(remoteUrl, dep);
yield return loader.Load();
}
var carLoader = AssetBundleLoader.Factory(remoteUrl, carBundleName);
yield return carLoader.Load();
if(carLoader.assetBundle != null)
{
op = carLoader.assetBundle.LoadAssetAsync<GameObject>(carName);
yield return op;
var prefab = op.asset as GameObject;
if(prefab != null)
GameObject.Instantiate(prefab, this.transform, false);
}
}
}
public class spawnCarFromRemoteAssetBundleWithDependencies : MonoBehaviour
{
// Simple class to handle loading asset bundles via UnityWebRequest
public class AssetBundleLoader
{
string uri;
string bundleName;
public AssetBundle assetBundle
{
get; private set;
}
public static AssetBundleLoader Factory(string uri, string bundleName)
{
return new AssetBundleLoader(uri, bundleName);
}
private AssetBundleLoader(string uri, string bundleName)
{
this.uri = uri;
this.bundleName = bundleName;
}
public IEnumerator Load()
{
var bundleUrl = Path.Combine(this.uri, this.bundleName);
var webReq = UnityWebRequest.GetAssetBundle(bundleUrl);
var handler = webReq.downloadHandler as
DownloadHandlerAssetBundle;
yield return webReq.Send();
assetBundle = handler.assetBundle;
}
}
public string carName;
public string carBundleName;
public string manifestName;
public string remoteUrl;
IEnumerator Start ()
{
var manifestLoader = AssetBundleLoader.Factory(remoteUrl,
bundleManifestName);
yield return manifestLoader.Load();
var manifestBundle = manifestLoader.assetBundle;
// Bail out if we can't load the manifest
if(manifestBundle == null)
{
Debug.LogWarning("Could not load asset bundle manifest.");
yield break;
}
var op =
manifestBundle.LoadAssetAsync<AssetBundleManifest>("AssetBundleManifest");
yield return op;
var manifest = op.asset as AssetBundleManifest;
var deps = manifest.GetAllDependencies(carBundleName);
foreach(var dep in deps)
{
Debug.LogFormat("Loading asset bundle dependency {0}", dep);
var loader = AssetBundleLoader.Factory(remoteUrl, dep);
yield return loader.Load();
}
var carLoader = AssetBundleLoader.Factory(remoteUrl, carBundleName);
yield return carLoader.Load();
if(carLoader.assetBundle != null)
{
op = carLoader.assetBundle.LoadAssetAsync<GameObject>(carName);
yield return op;
var prefab = op.asset as GameObject;
if(prefab != null)
GameObject.Instantiate(prefab, this.transform, false);
}
}
}
public class spawnCarFromResourcesAsync : MonoBehaviour
{
public string carName;
IEnumerator Start ()
{
var req = Resources.LoadAsync(carName);
yield return req;
if(req.asset != null)
GameObject.Instantiate(req.asset, this.transform, false);
}
}
•
•
•
•
•
•
• 

• 

•
•
•
•
•
✓ 

✓
✓
✓


★
★


【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

型安全性入門
型安全性入門型安全性入門
型安全性入門
 
アプリ開発者、DB 管理者視点での Cloud Spanner 活用方法 | 第 10 回 Google Cloud INSIDE Games & App...
アプリ開発者、DB 管理者視点での Cloud Spanner 活用方法 | 第 10 回 Google Cloud INSIDE Games & App...アプリ開発者、DB 管理者視点での Cloud Spanner 活用方法 | 第 10 回 Google Cloud INSIDE Games & App...
アプリ開発者、DB 管理者視点での Cloud Spanner 活用方法 | 第 10 回 Google Cloud INSIDE Games & App...
 
【Unity道場】新しいPrefabワークフロー入門
【Unity道場】新しいPrefabワークフロー入門【Unity道場】新しいPrefabワークフロー入門
【Unity道場】新しいPrefabワークフロー入門
 
Linux女子部 systemd徹底入門
Linux女子部 systemd徹底入門Linux女子部 systemd徹底入門
Linux女子部 systemd徹底入門
 
60fpsアクションを実現する秘訣を伝授 解析編
60fpsアクションを実現する秘訣を伝授 解析編60fpsアクションを実現する秘訣を伝授 解析編
60fpsアクションを実現する秘訣を伝授 解析編
 
UniTask入門
UniTask入門UniTask入門
UniTask入門
 
Dockerからcontainerdへの移行
Dockerからcontainerdへの移行Dockerからcontainerdへの移行
Dockerからcontainerdへの移行
 
CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例
CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例
CEDEC2019 大規模モバイルゲーム運用におけるマスタデータ管理事例
 
UE4を使った クロスシミュレーションと、 ハイエンド・モバイルゲーム制作の奥義を伝授!
UE4を使った クロスシミュレーションと、 ハイエンド・モバイルゲーム制作の奥義を伝授!UE4を使った クロスシミュレーションと、 ハイエンド・モバイルゲーム制作の奥義を伝授!
UE4を使った クロスシミュレーションと、 ハイエンド・モバイルゲーム制作の奥義を伝授!
 
やはりお前らのMVCは間違っている
やはりお前らのMVCは間違っているやはりお前らのMVCは間違っている
やはりお前らのMVCは間違っている
 
レシピの作り方入門
レシピの作り方入門レシピの作り方入門
レシピの作り方入門
 
誰もAddressableについて語らないなら、自分が語るしかない…ッッッッ
誰もAddressableについて語らないなら、自分が語るしかない…ッッッッ誰もAddressableについて語らないなら、自分が語るしかない…ッッッッ
誰もAddressableについて語らないなら、自分が語るしかない…ッッッッ
 
実践 NestJS
実践 NestJS実践 NestJS
実践 NestJS
 
Pythonによる黒魔術入門
Pythonによる黒魔術入門Pythonによる黒魔術入門
Pythonによる黒魔術入門
 
マテリアルとマテリアルインスタンスの仕組みと問題点の共有 (Epic Games Japan: 篠山範明) #UE4DD
マテリアルとマテリアルインスタンスの仕組みと問題点の共有 (Epic Games Japan: 篠山範明) #UE4DDマテリアルとマテリアルインスタンスの仕組みと問題点の共有 (Epic Games Japan: 篠山範明) #UE4DD
マテリアルとマテリアルインスタンスの仕組みと問題点の共有 (Epic Games Japan: 篠山範明) #UE4DD
 
GPU仮想化最前線 - KVMGTとvirtio-gpu -
GPU仮想化最前線 - KVMGTとvirtio-gpu -GPU仮想化最前線 - KVMGTとvirtio-gpu -
GPU仮想化最前線 - KVMGTとvirtio-gpu -
 
インタフェース完全に理解した
インタフェース完全に理解したインタフェース完全に理解した
インタフェース完全に理解した
 
Mask Material only in Early Z-passの効果と仕組み
Mask Material only in Early Z-passの効果と仕組みMask Material only in Early Z-passの効果と仕組み
Mask Material only in Early Z-passの効果と仕組み
 
Unityネットワーク通信の基盤である「RPC」について、意外と知られていないボトルネックと、その対策法
Unityネットワーク通信の基盤である「RPC」について、意外と知られていないボトルネックと、その対策法Unityネットワーク通信の基盤である「RPC」について、意外と知られていないボトルネックと、その対策法
Unityネットワーク通信の基盤である「RPC」について、意外と知られていないボトルネックと、その対策法
 
新入社員のための大規模ゲーム開発入門 サーバサイド編
新入社員のための大規模ゲーム開発入門 サーバサイド編新入社員のための大規模ゲーム開発入門 サーバサイド編
新入社員のための大規模ゲーム開発入門 サーバサイド編
 

Andere mochten auch

Andere mochten auch (19)

【Unite 2017 Tokyo】セルシェーダーを使用した3Dキャラアプリの開発事例
【Unite 2017 Tokyo】セルシェーダーを使用した3Dキャラアプリの開発事例【Unite 2017 Tokyo】セルシェーダーを使用した3Dキャラアプリの開発事例
【Unite 2017 Tokyo】セルシェーダーを使用した3Dキャラアプリの開発事例
 
Unityでlinqを使おう
Unityでlinqを使おうUnityでlinqを使おう
Unityでlinqを使おう
 
良くわかるMeta
良くわかるMeta良くわかるMeta
良くわかるMeta
 
Gtmf2011 2011.06.07 slideshare
Gtmf2011 2011.06.07 slideshareGtmf2011 2011.06.07 slideshare
Gtmf2011 2011.06.07 slideshare
 
【Unite 2017 Tokyo】バグを殲滅!Unityにおける実践テスト手法
【Unite 2017 Tokyo】バグを殲滅!Unityにおける実践テスト手法【Unite 2017 Tokyo】バグを殲滅!Unityにおける実践テスト手法
【Unite 2017 Tokyo】バグを殲滅!Unityにおける実践テスト手法
 
【Unite 2017 Tokyo】中国でAndroidアプリを出す!Xiaomiストアでのアプリリリース、収益化のためにできること
【Unite 2017 Tokyo】中国でAndroidアプリを出す!Xiaomiストアでのアプリリリース、収益化のためにできること【Unite 2017 Tokyo】中国でAndroidアプリを出す!Xiaomiストアでのアプリリリース、収益化のためにできること
【Unite 2017 Tokyo】中国でAndroidアプリを出す!Xiaomiストアでのアプリリリース、収益化のためにできること
 
Unity での asset bundle による追加コンテンツの扱い方
Unity での asset bundle による追加コンテンツの扱い方Unity での asset bundle による追加コンテンツの扱い方
Unity での asset bundle による追加コンテンツの扱い方
 
【Unite 2017 Tokyo】いかにして個人制作ゲームで生きていくか〜スマホゲームレッドオーシャンの泳ぎ方〜
【Unite 2017 Tokyo】いかにして個人制作ゲームで生きていくか〜スマホゲームレッドオーシャンの泳ぎ方〜【Unite 2017 Tokyo】いかにして個人制作ゲームで生きていくか〜スマホゲームレッドオーシャンの泳ぎ方〜
【Unite 2017 Tokyo】いかにして個人制作ゲームで生きていくか〜スマホゲームレッドオーシャンの泳ぎ方〜
 
【Unite 2017 Tokyo】新アセットバンドルツール詳解:アセット設定とアセットバンドルのワークフローを簡単に
【Unite 2017 Tokyo】新アセットバンドルツール詳解:アセット設定とアセットバンドルのワークフローを簡単に【Unite 2017 Tokyo】新アセットバンドルツール詳解:アセット設定とアセットバンドルのワークフローを簡単に
【Unite 2017 Tokyo】新アセットバンドルツール詳解:アセット設定とアセットバンドルのワークフローを簡単に
 
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
【Unite 2017 Tokyo】ScriptableObjectを使ってプログラマーもアーティストも幸せになろう
 
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
【Unite 2017 Tokyo】Unity UI最適化ガイド 〜ベストプラクティスと新機能
 
AssetBundle (もどき) の作り方
AssetBundle (もどき) の作り方AssetBundle (もどき) の作り方
AssetBundle (もどき) の作り方
 
【Unite 2017 Tokyo】VRで探り,活用する,人の知覚の仕組み
【Unite 2017 Tokyo】VRで探り,活用する,人の知覚の仕組み【Unite 2017 Tokyo】VRで探り,活用する,人の知覚の仕組み
【Unite 2017 Tokyo】VRで探り,活用する,人の知覚の仕組み
 
【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術
【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術
【Unite 2017 Tokyo】最適化をする前に覚えておきたい技術
 
【Unite 2017 Tokyo】Unity最適化講座 ~スペシャリストが教えるメモリとCPU使用率の負担最小化テクニック~
【Unite 2017 Tokyo】Unity最適化講座 ~スペシャリストが教えるメモリとCPU使用率の負担最小化テクニック~【Unite 2017 Tokyo】Unity最適化講座 ~スペシャリストが教えるメモリとCPU使用率の負担最小化テクニック~
【Unite 2017 Tokyo】Unity最適化講座 ~スペシャリストが教えるメモリとCPU使用率の負担最小化テクニック~
 
【Unite 2017 Tokyo】Navmesh完全マスターへの道
【Unite 2017 Tokyo】Navmesh完全マスターへの道【Unite 2017 Tokyo】Navmesh完全マスターへの道
【Unite 2017 Tokyo】Navmesh完全マスターへの道
 
LINQ in Unity
LINQ in UnityLINQ in Unity
LINQ in Unity
 
UniRx - Reactive Extensions for Unity
UniRx - Reactive Extensions for UnityUniRx - Reactive Extensions for Unity
UniRx - Reactive Extensions for Unity
 
Binary Reading in C#
Binary Reading in C#Binary Reading in C#
Binary Reading in C#
 

Ähnlich wie 【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ

The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it means
Robert Nyman
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
Alexey Buzdin
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
C.T.Co
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao PauloJavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
Robert Nyman
 
JavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos AiresJavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
Robert Nyman
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, ChileJavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
Robert Nyman
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, MontevideoJavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
Robert Nyman
 
Spring Orielly
Spring OriellySpring Orielly
Spring Orielly
jbashask
 

Ähnlich wie 【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ (20)

Android workshop
Android workshopAndroid workshop
Android workshop
 
Android Loaders : Reloaded
Android Loaders : ReloadedAndroid Loaders : Reloaded
Android Loaders : Reloaded
 
Pathfinding - Part 2: Examples in Unity
Pathfinding - Part 2: Examples in UnityPathfinding - Part 2: Examples in Unity
Pathfinding - Part 2: Examples in Unity
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
Introduction to CQRS and Event Sourcing
Introduction to CQRS and Event SourcingIntroduction to CQRS and Event Sourcing
Introduction to CQRS and Event Sourcing
 
4.Spring IoC&DI(Spring Ioc실습_어노테이션 기반)
4.Spring IoC&DI(Spring Ioc실습_어노테이션 기반)4.Spring IoC&DI(Spring Ioc실습_어노테이션 기반)
4.Spring IoC&DI(Spring Ioc실습_어노테이션 기반)
 
The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it means
 
03 page navigation and data binding in windows runtime apps
03   page navigation and data binding in windows runtime apps03   page navigation and data binding in windows runtime apps
03 page navigation and data binding in windows runtime apps
 
Android Concurrency Presentation
Android Concurrency PresentationAndroid Concurrency Presentation
Android Concurrency Presentation
 
Pro typescript.ch03.Object Orientation in TypeScript
Pro typescript.ch03.Object Orientation in TypeScriptPro typescript.ch03.Object Orientation in TypeScript
Pro typescript.ch03.Object Orientation in TypeScript
 
The evolution of asynchronous JavaScript
The evolution of asynchronous JavaScriptThe evolution of asynchronous JavaScript
The evolution of asynchronous JavaScript
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao PauloJavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
 
JavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos AiresJavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, ChileJavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, MontevideoJavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
 
Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 
Spring Orielly
Spring OriellySpring Orielly
Spring Orielly
 
droidcon Transylvania - Kotlin Coroutines
droidcon Transylvania - Kotlin Coroutinesdroidcon Transylvania - Kotlin Coroutines
droidcon Transylvania - Kotlin Coroutines
 

Mehr von Unite2017Tokyo

Mehr von Unite2017Tokyo (20)

【Unite 2017 Tokyo】スマートフォンゲーム「夢幻のラビリズ」開発秘話と動画・サウンドミドルウェアの使い処
【Unite 2017 Tokyo】スマートフォンゲーム「夢幻のラビリズ」開発秘話と動画・サウンドミドルウェアの使い処【Unite 2017 Tokyo】スマートフォンゲーム「夢幻のラビリズ」開発秘話と動画・サウンドミドルウェアの使い処
【Unite 2017 Tokyo】スマートフォンゲーム「夢幻のラビリズ」開発秘話と動画・サウンドミドルウェアの使い処
 
【Unite 2017 Tokyo】Virtual Design and Construction + AR/VR ~建築におけるUnity活用事例~
【Unite 2017 Tokyo】Virtual Design and Construction + AR/VR ~建築におけるUnity活用事例~【Unite 2017 Tokyo】Virtual Design and Construction + AR/VR ~建築におけるUnity活用事例~
【Unite 2017 Tokyo】Virtual Design and Construction + AR/VR ~建築におけるUnity活用事例~
 
【Unite 2017 Tokyo】2017年の注目アセット100連発
【Unite 2017 Tokyo】2017年の注目アセット100連発【Unite 2017 Tokyo】2017年の注目アセット100連発
【Unite 2017 Tokyo】2017年の注目アセット100連発
 
【Unite 2017 Tokyo】VR MAGIC! ~キャラクターに命を吹き込んだこの4年間の記録~
【Unite 2017 Tokyo】VR MAGIC! ~キャラクターに命を吹き込んだこの4年間の記録~【Unite 2017 Tokyo】VR MAGIC! ~キャラクターに命を吹き込んだこの4年間の記録~
【Unite 2017 Tokyo】VR MAGIC! ~キャラクターに命を吹き込んだこの4年間の記録~
 
【Unite 2017 Tokyo】Unity+WebGLでゲームを開発・運用して見えてきたメリット・デメリット
【Unite 2017 Tokyo】Unity+WebGLでゲームを開発・運用して見えてきたメリット・デメリット【Unite 2017 Tokyo】Unity+WebGLでゲームを開発・運用して見えてきたメリット・デメリット
【Unite 2017 Tokyo】Unity+WebGLでゲームを開発・運用して見えてきたメリット・デメリット
 
【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来
【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来
【Unite 2017 Tokyo】Anima2Dについて語るで!2Dアニメーションの未来
 
【Unite 2017 Tokyo】“Game Jam x VR x Unity”『Dead Hungry』のレシピ
【Unite 2017 Tokyo】“Game Jam x VR x Unity”『Dead Hungry』のレシピ【Unite 2017 Tokyo】“Game Jam x VR x Unity”『Dead Hungry』のレシピ
【Unite 2017 Tokyo】“Game Jam x VR x Unity”『Dead Hungry』のレシピ
 
【Unite 2017 Tokyo】「オルタナティブガールズ」〜50cmの距離感で3D美少女を最高にかわいく魅せる方法〜
【Unite 2017 Tokyo】「オルタナティブガールズ」〜50cmの距離感で3D美少女を最高にかわいく魅せる方法〜【Unite 2017 Tokyo】「オルタナティブガールズ」〜50cmの距離感で3D美少女を最高にかわいく魅せる方法〜
【Unite 2017 Tokyo】「オルタナティブガールズ」〜50cmの距離感で3D美少女を最高にかわいく魅せる方法〜
 
【Unite 2017 Tokyo】Unityで出来る『見える開発』のススメ 〜スマホゲーム「ららマジ」開発事例〜
【Unite 2017 Tokyo】Unityで出来る『見える開発』のススメ 〜スマホゲーム「ららマジ」開発事例〜【Unite 2017 Tokyo】Unityで出来る『見える開発』のススメ 〜スマホゲーム「ららマジ」開発事例〜
【Unite 2017 Tokyo】Unityで出来る『見える開発』のススメ 〜スマホゲーム「ららマジ」開発事例〜
 
【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザイン
【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザイン【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザイン
【Unite 2017 Tokyo】EditorVRの設計から学んだこと:使えるVRエディターのためのデザイン
 
【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~
【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~
【Unite 2017 Tokyo】Unityを使ったNintendo Switch™ローンチタイトル制作~スーパーボンバーマンRの事例~
 
【Unite 2017 Tokyo】Nintendo Switch™ 本体同時発売必達、家庭用向けRPG「いけにえと雪のセツナ」開発の裏側
【Unite 2017 Tokyo】Nintendo Switch™ 本体同時発売必達、家庭用向けRPG「いけにえと雪のセツナ」開発の裏側【Unite 2017 Tokyo】Nintendo Switch™ 本体同時発売必達、家庭用向けRPG「いけにえと雪のセツナ」開発の裏側
【Unite 2017 Tokyo】Nintendo Switch™ 本体同時発売必達、家庭用向けRPG「いけにえと雪のセツナ」開発の裏側
 
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
【Unite 2017 Tokyo】インスタンシングを用いた美麗なグラフィックの実現方法
 
【Unite 2017 Tokyo】3次元CAD VR化最速ツールの秘密
【Unite 2017 Tokyo】3次元CAD VR化最速ツールの秘密【Unite 2017 Tokyo】3次元CAD VR化最速ツールの秘密
【Unite 2017 Tokyo】3次元CAD VR化最速ツールの秘密
 
【Unite 2017 Tokyo】WebGL:ゲームプラットフォームとしてのWebと現在と未来
【Unite 2017 Tokyo】WebGL:ゲームプラットフォームとしてのWebと現在と未来【Unite 2017 Tokyo】WebGL:ゲームプラットフォームとしてのWebと現在と未来
【Unite 2017 Tokyo】WebGL:ゲームプラットフォームとしてのWebと現在と未来
 
【Unite 2017 Tokyo】Unityライティング最新情報
【Unite 2017 Tokyo】Unityライティング最新情報【Unite 2017 Tokyo】Unityライティング最新情報
【Unite 2017 Tokyo】Unityライティング最新情報
 
【Unite 2017 Tokyo】スマホゲーム開発者なら知っておくべきチートのリスク&対策
【Unite 2017 Tokyo】スマホゲーム開発者なら知っておくべきチートのリスク&対策【Unite 2017 Tokyo】スマホゲーム開発者なら知っておくべきチートのリスク&対策
【Unite 2017 Tokyo】スマホゲーム開発者なら知っておくべきチートのリスク&対策
 
【Unite 2017 Tokyo】VIVEとUnityで、1週間で作る漫才VR
【Unite 2017 Tokyo】VIVEとUnityで、1週間で作る漫才VR【Unite 2017 Tokyo】VIVEとUnityで、1週間で作る漫才VR
【Unite 2017 Tokyo】VIVEとUnityで、1週間で作る漫才VR
 
【Unite 2017 Tokyo】DIYエフェクト実装: エンジニアレスでエフェクトを組み込める環境づくり
【Unite 2017 Tokyo】DIYエフェクト実装: エンジニアレスでエフェクトを組み込める環境づくり【Unite 2017 Tokyo】DIYエフェクト実装: エンジニアレスでエフェクトを組み込める環境づくり
【Unite 2017 Tokyo】DIYエフェクト実装: エンジニアレスでエフェクトを組み込める環境づくり
 
【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイド
【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイド【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイド
【Unite 2017 Tokyo】VRコンテンツを気持ちよくプレイさせるためのUI実装ガイド
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 10.
  • 13.
  • 14.
  • 15. Unityプロジェクト 開発初週 - 直接参照 public class spawnCarFromDirectReference : MonoBehaviour { public GameObject carPrefab; void Start () { if(carPrefab != null) GameObject.Instantiate(carPrefab, this.transform, false); } }
  • 16. Unityプロジェクト,開発2週目 - Resources.Load public class spawnCarFromResources : MonoBehaviour { public string carName; void Start () { var go = Resources.Load<GameObject>(carName); if(go != null) GameObject.Instantiate(go, this.transform, false); } }
  • 17. Unityプロジェクト,開発3週目 - Resources.LoadAsync public class spawnCarFromResourcesAsync : MonoBehaviour { public string carName; IEnumerator Start () { var req = Resources.LoadAsync(carName); yield return req; if(req.asset != null) GameObject.Instantiate(req.asset, this.transform, false); } }
  • 19. Resourcesからアセットバンドルへの変更 public class MyBuildProcess { ... [MenuItem("Build/Build Asset Bundles")] public static void BuildAssetBundles() { var outputPath = bundleBuildPath; if(!Directory.Exists(outputPath)) Directory.CreateDirectory(outputPath); var manifest = BuildPipeline.BuildAssetBundles(outputPath, BuildAssetBundleOptions.ChunkBasedCompression, EditorUserBuildSettings.activeBuildTarget); var bundlesToCopy = new List<string>(manifest.GetAllAssetBundles()); // Copy the manifest file bundlesToCopy.Add(EditorUserBuildSettings.activeBuildTarget.ToString()); CopyBundlesToStreamingAssets(bundlesToCopy); } ... }
  • 20. Resourcesからアセットバンドルへの変更 public class spawnCarFromBuiltinAssetBundle : MonoBehaviour { public string carName; public string carBundleName; IEnumerator Start () { if(!string.IsNullOrEmpty(carBundleName)) { var bundleReq = AssetBundle.LoadFromFileAsync(carBundleName); yield return bundleReq; var bundle = bundleReq.assetBundle; if( bundle != null) { var assetReq = bundle.LoadAssetAsync(carName); yield return assetReq; if(assetReq.asset != null) GameObject.Instantiate(assetReq.asset, this.transform, false); } } } }
  • 22. Asset BundlesをCDNからロードするよう書き換え public class spawnCarFromRemoteAssetBundle : MonoBehaviour { public string carName; public string carBundleName; public string remoteUrl; IEnumerator Start () { var bundleUrl = Path.Combine(remoteUrl, carBundleName); var webReq = UnityWebRequest.GetAssetBundle(bundleUrl); var handler = webReq.downloadHandler as DownloadHandlerAssetBundle; yield return webReq.Send(); var bundle = handler.assetBundle; if(bundle != null) { var prefab = bundle.LoadAsset<GameObject>(carName); if(prefab != null) GameObject.Instantiate(prefab, this.transform, false); } } }
  • 23. Loading Asset Bundles from CDN public class spawnCarFromRemoteAssetBundle : MonoBehaviour { public string carName; public string carBundleName; public string remoteUrl; IEnumerator Start () { var bundleUrl = Path.Combine(remoteUrl, carBundleName); var webReq = UnityWebRequest.GetAssetBundle(bundleUrl); var handler = webReq.downloadHandler as DownloadHandlerAssetBundle; yield return webReq.Send(); var bundle = handler.assetBundle; if(bundle != null) { var prefab = bundle.LoadAsset<GameObject>(carName); if(prefab != null) GameObject.Instantiate(prefab, this.transform, false); } } } こ ん な コ ー ド じ ゃ 無 理 ! !
  • 24.
  • 25. public class spawnCarFromRemoteAssetBundleWithDependencies : MonoBehaviour { // Simple class to handle loading asset bundles via UnityWebRequest public class AssetBundleLoader { string uri; string bundleName; public AssetBundle assetBundle { get; private set; } public static AssetBundleLoader Factory(string uri, string bundleName) { return new AssetBundleLoader(uri, bundleName); } private AssetBundleLoader(string uri, string bundleName) { this.uri = uri; this.bundleName = bundleName; } public IEnumerator Load() { var bundleUrl = Path.Combine(this.uri, this.bundleName); var webReq = UnityWebRequest.GetAssetBundle(bundleUrl); var handler = webReq.downloadHandler as DownloadHandlerAssetBundle; yield return webReq.Send(); assetBundle = handler.assetBundle; } } public string carName; public string carBundleName; public string manifestName; public string remoteUrl; IEnumerator Start () { var manifestLoader = AssetBundleLoader.Factory(remoteUrl, bundleManifestName); yield return manifestLoader.Load(); var manifestBundle = manifestLoader.assetBundle; // Bail out if we can't load the manifest if(manifestBundle == null) { Debug.LogWarning("Could not load asset bundle manifest."); yield break; } var op = manifestBundle.LoadAssetAsync<AssetBundleManifest>("AssetBundleManifest"); yield return op; var manifest = op.asset as AssetBundleManifest; var deps = manifest.GetAllDependencies(carBundleName); foreach(var dep in deps) { Debug.LogFormat("Loading asset bundle dependency {0}", dep); var loader = AssetBundleLoader.Factory(remoteUrl, dep); yield return loader.Load(); } var carLoader = AssetBundleLoader.Factory(remoteUrl, carBundleName); yield return carLoader.Load(); if(carLoader.assetBundle != null) { op = carLoader.assetBundle.LoadAssetAsync<GameObject>(carName); yield return op; var prefab = op.asset as GameObject; if(prefab != null) GameObject.Instantiate(prefab, this.transform, false); } } }
  • 27.
  • 28.
  • 31.
  • 32.
  • 34.
  • 35.
  • 36.
  • 45. Bundle Build Pipeline Overhaul Sneak Peak public static AssetBundleBuildInput GenerateAssetBundleBuildInput( AssetBundleBuildSettings settings) { … } public struct AssetBundleBuildInput { public struct Definition { public string name; public string variant; public GUID[] assets; } public AssetBundleBuildSettings settings; public Definition[] bundles; } * Input generated from asset importer meta data or any other source (external tools, etc.) 

  • 46. Bundle Build Pipeline Overhaul Sneak Peak public static AssetBundleBuildCommandSet GenerateAssetBuildCommandSet( AssetBundleBuildInput buildInput) { … } public struct AssetBundleBuildCommandSet { public struct Command { public AssetBundleBuildInput.Definition input; public ObjectIdentifier[] objectsToBeWritten; } public AssetBundleBuildSettings settings; public Command[] commands; } Command set generation gathers all dependencies, handles object stripping, and generates full list of objects to write. 

  • 47. Bundle Build Pipeline Overhaul Sneak Peak public static void SaveAssetBundleOutput(AssetBundleBuildOutput output) { … } Output can be serialized to JSON or any other format as required.
  • 48. Bundle Build Pipeline Overhaul Sneak Peak public static void SaveAssetBundleOutput(AssetBundleBuildOutput output) { … } Put it all together … // Default build pipeline SaveAssetBundleOutput(ExecuteAssetBuildCommandSet(GenerateAssetBuildComma ndSet(GenerateAssetBundleBuildInput(settings))));

  • 54.
  • 55. public class spawnCarFromRemoteAssetBundleWithDependencies : MonoBehaviour { // Simple class to handle loading asset bundles via UnityWebRequest public class AssetBundleLoader { string uri; string bundleName; public AssetBundle assetBundle { get; private set; } public static AssetBundleLoader Factory(string uri, string bundleName) { return new AssetBundleLoader(uri, bundleName); } private AssetBundleLoader(string uri, string bundleName) { this.uri = uri; this.bundleName = bundleName; } public IEnumerator Load() { var bundleUrl = Path.Combine(this.uri, this.bundleName); var webReq = UnityWebRequest.GetAssetBundle(bundleUrl); var handler = webReq.downloadHandler as DownloadHandlerAssetBundle; yield return webReq.Send(); assetBundle = handler.assetBundle; } } public string carName; public string carBundleName; public string manifestName; public string remoteUrl; IEnumerator Start () { var manifestLoader = AssetBundleLoader.Factory(remoteUrl, bundleManifestName); yield return manifestLoader.Load(); var manifestBundle = manifestLoader.assetBundle; // Bail out if we can't load the manifest if(manifestBundle == null) { Debug.LogWarning("Could not load asset bundle manifest."); yield break; } var op = manifestBundle.LoadAssetAsync<AssetBundleManifest>("AssetBundleManifest"); yield return op; var manifest = op.asset as AssetBundleManifest; var deps = manifest.GetAllDependencies(carBundleName); foreach(var dep in deps) { Debug.LogFormat("Loading asset bundle dependency {0}", dep); var loader = AssetBundleLoader.Factory(remoteUrl, dep); yield return loader.Load(); } var carLoader = AssetBundleLoader.Factory(remoteUrl, carBundleName); yield return carLoader.Load(); if(carLoader.assetBundle != null) { op = carLoader.assetBundle.LoadAssetAsync<GameObject>(carName); yield return op; var prefab = op.asset as GameObject; if(prefab != null) GameObject.Instantiate(prefab, this.transform, false); } } }
  • 56. public class spawnCarFromRemoteAssetBundleWithDependencies : MonoBehaviour { // Simple class to handle loading asset bundles via UnityWebRequest public class AssetBundleLoader { string uri; string bundleName; public AssetBundle assetBundle { get; private set; } public static AssetBundleLoader Factory(string uri, string bundleName) { return new AssetBundleLoader(uri, bundleName); } private AssetBundleLoader(string uri, string bundleName) { this.uri = uri; this.bundleName = bundleName; } public IEnumerator Load() { var bundleUrl = Path.Combine(this.uri, this.bundleName); var webReq = UnityWebRequest.GetAssetBundle(bundleUrl); var handler = webReq.downloadHandler as DownloadHandlerAssetBundle; yield return webReq.Send(); assetBundle = handler.assetBundle; } } public string carName; public string carBundleName; public string manifestName; public string remoteUrl; IEnumerator Start () { var manifestLoader = AssetBundleLoader.Factory(remoteUrl, bundleManifestName); yield return manifestLoader.Load(); var manifestBundle = manifestLoader.assetBundle; // Bail out if we can't load the manifest if(manifestBundle == null) { Debug.LogWarning("Could not load asset bundle manifest."); yield break; } var op = manifestBundle.LoadAssetAsync<AssetBundleManifest>("AssetBundleManifest"); yield return op; var manifest = op.asset as AssetBundleManifest; var deps = manifest.GetAllDependencies(carBundleName); foreach(var dep in deps) { Debug.LogFormat("Loading asset bundle dependency {0}", dep); var loader = AssetBundleLoader.Factory(remoteUrl, dep); yield return loader.Load(); } var carLoader = AssetBundleLoader.Factory(remoteUrl, carBundleName); yield return carLoader.Load(); if(carLoader.assetBundle != null) { op = carLoader.assetBundle.LoadAssetAsync<GameObject>(carName); yield return op; var prefab = op.asset as GameObject; if(prefab != null) GameObject.Instantiate(prefab, this.transform, false); } } }
  • 57. public class spawnCarFromResourcesAsync : MonoBehaviour { public string carName; IEnumerator Start () { var req = Resources.LoadAsync(carName); yield return req; if(req.asset != null) GameObject.Instantiate(req.asset, this.transform, false); } }
  • 58.
  • 63.
  • 64.
  • 65.
  • 67.
  • 68.