|
@@ -7,7 +7,10 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
#region
|
|
|
|
|
|
+ public static bool LoadComplete;
|
|
|
+
|
|
|
public static Bundle Instance;
|
|
|
+
|
|
|
public static AssetBundle UI;
|
|
|
public static AssetBundle Skill;
|
|
|
public static AssetBundle Config;
|
|
@@ -16,17 +19,32 @@ public class Bundle : MonoBehaviour
|
|
|
public static AssetBundle Garden;
|
|
|
public static AssetBundle Character;
|
|
|
|
|
|
+ public static AssetBundle TempUI;
|
|
|
+ public static AssetBundle TempSkill;
|
|
|
+ public static AssetBundle TempConfig;
|
|
|
+ public static AssetBundle TempObject;
|
|
|
+ public static AssetBundle TempShader;
|
|
|
+ public static AssetBundle TempGarden;
|
|
|
+ public static AssetBundle TempCharacter;
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
public void Awake()
|
|
|
{
|
|
|
Instance = this;
|
|
|
+
|
|
|
+ DontDestroyOnLoad(gameObject);
|
|
|
+
|
|
|
+ LoadAll
|
|
|
+ (
|
|
|
+ () => LoadComplete = true
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
|
|
|
public static string GetStreamPath()
|
|
|
{
|
|
|
- return "file://" + Application.streamingAssetsPath + "/Bundle/Andriod/";
|
|
|
+ return "file://" + Application.streamingAssetsPath + "/Bundle/Windows/";
|
|
|
}
|
|
|
|
|
|
|
|
@@ -45,7 +63,10 @@ public class Bundle : MonoBehaviour
|
|
|
yield return LoadGarden();
|
|
|
yield return LoadCharacter();
|
|
|
|
|
|
- callback.Invoke();
|
|
|
+ if (callback != null)
|
|
|
+ {
|
|
|
+ callback.Invoke();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -63,6 +84,15 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
Debug.Log(www.error);
|
|
|
}
|
|
|
+
|
|
|
+ www = new WWW(GetStreamPath() + "uitemp");
|
|
|
+
|
|
|
+ yield return www;
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(www.error))
|
|
|
+ {
|
|
|
+ TempUI = www.assetBundle;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static IEnumerator LoadSkill()
|
|
@@ -79,6 +109,15 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
Debug.Log(www.error);
|
|
|
}
|
|
|
+
|
|
|
+ www = new WWW(GetStreamPath() + "skilltemp");
|
|
|
+
|
|
|
+ yield return www;
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(www.error))
|
|
|
+ {
|
|
|
+ TempSkill = www.assetBundle;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static IEnumerator LoadConfig()
|
|
@@ -95,6 +134,15 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
Debug.Log(www.error);
|
|
|
}
|
|
|
+
|
|
|
+ www = new WWW(GetStreamPath() + "configtemp");
|
|
|
+
|
|
|
+ yield return www;
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(www.error))
|
|
|
+ {
|
|
|
+ TempConfig = www.assetBundle;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static IEnumerator LoadObject()
|
|
@@ -111,6 +159,15 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
Debug.Log(www.error);
|
|
|
}
|
|
|
+
|
|
|
+ www = new WWW(GetStreamPath() + "objecttemp");
|
|
|
+
|
|
|
+ yield return www;
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(www.error))
|
|
|
+ {
|
|
|
+ TempObject = www.assetBundle;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static IEnumerator LoadShader()
|
|
@@ -127,6 +184,15 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
Debug.Log(www.error);
|
|
|
}
|
|
|
+
|
|
|
+ www = new WWW(GetStreamPath() + "shadertemp");
|
|
|
+
|
|
|
+ yield return www;
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(www.error))
|
|
|
+ {
|
|
|
+ TempShader = www.assetBundle;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static IEnumerator LoadGarden()
|
|
@@ -143,6 +209,15 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
Debug.Log(www.error);
|
|
|
}
|
|
|
+
|
|
|
+ www = new WWW(GetStreamPath() + "gardentemp");
|
|
|
+
|
|
|
+ yield return www;
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(www.error))
|
|
|
+ {
|
|
|
+ TempGarden = www.assetBundle;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static IEnumerator LoadCharacter()
|
|
@@ -159,5 +234,14 @@ public class Bundle : MonoBehaviour
|
|
|
{
|
|
|
Debug.Log(www.error);
|
|
|
}
|
|
|
+
|
|
|
+ www = new WWW(GetStreamPath() + "charactertemp");
|
|
|
+
|
|
|
+ yield return www;
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(www.error))
|
|
|
+ {
|
|
|
+ TempCharacter = www.assetBundle;
|
|
|
+ }
|
|
|
}
|
|
|
}
|