本文整理汇总了C#中UnityEngine.AssetBundle.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# AssetBundle.Contains方法的具体用法?C# AssetBundle.Contains怎么用?C# AssetBundle.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.AssetBundle
的用法示例。
在下文中一共展示了AssetBundle.Contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindFirstGizmoAvailable
public int FindFirstGizmoAvailable(AssetBundle assetBundle, string stairName)
{
ObjData objData = GetComponent<ObjData> ();
OSLibObject objModel = objData.GetObjectModel ();
string baseModelPath = objModel.GetModel ().GetPath ();
for (int gizmoIndex = 0; gizmoIndex < _gizmos.Count; ++gizmoIndex)
{
string path = baseModelPath + "_" + stairName + "_" + (gizmoIndex + 1);
if (assetBundle.Contains (path))
{
return gizmoIndex;
}
}
return -1;
}
示例2: WWWLoad
/// <summary>
/// www加载AB资源
/// </summary>
/// <returns></returns>
public IEnumerator WWWLoad()
{
Debug.Log("WWWLoad 11");
WWW www = new WWW(assetPath);
yield return www;
Debug.Log("WWWLoad 22");
if (!string.IsNullOrEmpty(www.error))
{
Debug.LogWarning("WWWLoad is error:" + www.error + "!AssetPath is " + assetPath);
yield break;
}
assetBundle = www.assetBundle;
if (assetBundle != null)
{
if (isMainAsset)
{
objectLoad = assetBundle.mainAsset;
}
else
{
if (assetBundle.Contains(assetName))
{
if (isLoadSyn)
objectLoad = null;//assetBundle.Load(assetName, typeof(Object));
else
{
Debug.Log("WWWLoad 33");
AssetBundleRequest abReq = null; //assetBundle.LoadAsync(assetName, typeof(Object));
yield return abReq;
Debug.Log("WWWLoad 44");
if (abReq.isDone)
objectLoad = abReq.asset;
}
}
}
}
assetBundle.Unload(false);
www.Dispose();
}