static public void InitializeMaifest() { #if UNITY_EDITOR m_BaseDownloadingURL = Application.streamingAssetsPath + "/" + SFMisc.GetPlatformName() + "/"; #else m_BaseDownloadingURL = Application.persistentDataPath + "/" + SFMisc.GetPlatformName() + "/"; //m_BaseDownloadingURL = Application.persistentDataPath + "/Android/"; #endif string path = m_BaseDownloadingURL + SFMisc.GetPlatformName(); //Debug.LogError("-------------------------------------------------------------- "+path); AssetBundle ab = AssetBundle.LoadFromFile(path); if (ab != null) { AssetBundleManifestObject = ab.LoadAsset <AssetBundleManifest>("AssetBundleManifest"); } else { if (Debug.developerConsoleVisible) { Debug.LogError("--------------AssetBundleManifest -----------"); } } }
static public AssetBundleLoadManifestOperation Initialize() { m_BaseDownloadingURL = GetStreamingAssetsPath() + SFMisc.GetPlatformName() + "/"; if (Debug.developerConsoleVisible) { Debug.Log(m_BaseDownloadingURL); } return(Initialize(SFMisc.GetPlatformName())); }
static public GameObject LoadUIAsset(string assetName, Transform parent) { LoadedAssetBundle assetBudle = LoadUIAssetAsync("ui/" + assetName.ToLower()); GameObject instClone = null; if (assetBudle != null) { GameObject gp = assetBudle.m_AssetBundle.LoadAsset <GameObject>(assetName); if (gp != null) { instClone = GameObject.Instantiate(gp); } SFMisc.SetParent(parent, instClone); return(instClone); } return(instClone); }
void OnLoaded(CSResource res) { if (!mIsShow) { return; } if (SFOut.IScene == null) { return; } if (mLine == null) { ISFAvater avatar = SFOut.IScene.getAvatarByISFAvatar(avatarID1); if (avatar == null) { return; } GameObject go = res.GetObjInst() as GameObject; if (go == null) { return; } SFMisc.SetLayer(go, 0); Transform trans = go.transform; trans.parent = avatar.CacheTransform; trans.localPosition = Vector3.zero; trans.localScale = Vector3.one; mLine = go.GetComponent <LineRenderer>(); } if (mLine == null) { Destroy(); return; } UpdateLinePos(); }