-
Notifications
You must be signed in to change notification settings - Fork 0
/
AssetBundleManager.cs
46 lines (32 loc) · 1.25 KB
/
AssetBundleManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using UnityEngine;
using System.Collections.Generic;
public class AssetBundleManager
{
private readonly Main _main;
public GameObject FrontCarGo;
public GameObject BackCarGo;
public GameObject[] Support_Go;
public GameObject[] AngledSupportGo;
public GameObject SupportHalf;
private readonly AssetBundle assetBundle;
public AssetBundleManager (Main main)
{
this._main = main;
var dsc = System.IO.Path.DirectorySeparatorChar;
assetBundle = AssetBundle.LoadFromFile(_main.Path + dsc + "assetbundle" + dsc + "reel");
FrontCarGo = assetBundle.LoadAsset<GameObject> ("Front_Car");
BackCarGo = assetBundle.LoadAsset<GameObject> ("Cart");
Support_Go = new GameObject[] {
assetBundle.LoadAsset<GameObject> ("Support_1"),
assetBundle.LoadAsset<GameObject> ("Support_2"),
assetBundle.LoadAsset<GameObject> ("Support_3 1")
};
AngledSupportGo = new GameObject[] {
assetBundle.LoadAsset<GameObject>("Angle_support_1"),
assetBundle.LoadAsset<GameObject>("Angle_support_2")
};
SupportHalf = assetBundle.LoadAsset<GameObject> ("Half_Support");
assetBundle.Unload(false);
}
}