void AssetReferer.ReferAsset(AssetUnitInfo assetUnitInfo, AssetReferenceListener listener) { string[] assetRef = assetUnitInfo.reference.Split(':'); if (System.Collections.CaseInsensitiveComparer.Equals(assetRef[0], "github")) { listener.OnBeginRefering(); //whole repository if (assetRef.Length == 2) { listener.OnBasicIOObtained(new GitHubAssetBasicIO { parent = this, repositoryAddress = assetRef[1], auInfo = assetUnitInfo }); listener.OnFinish(); } if (assetRef.Length == 3) { var www = new UnityWebRequest(addressBase + assetRef[1] + assetRef[2]); NetworkUtil.ProcessWebRequest(www, (givenWWW) => { if (string.IsNullOrEmpty(givenWWW.error)) { listener.OnRawAssetContentObtained(givenWWW.downloadHandler.data, assetRef[2]); } listener.OnFinish(); }); } } }
void AssetReferer.ReferAsset(AssetUnitInfo assetUnitInfo, AssetReferenceListener listener) { if (assetUnitInfo.reference.StartsWith("file:///")) { listener.OnBeginRefering(); if (!assetUnitInfo.reference.EndsWith("/")) { ; UnityWebRequest www = new UnityWebRequest(assetUnitInfo.reference); NetworkUtil.ProcessWebRequest(www, (givenWWW) => { if (string.IsNullOrEmpty(givenWWW.error)) { listener.OnRawAssetContentObtained(givenWWW.downloadHandler.data, ""); } listener.OnFinish(); }); } else { //whole repository listener.OnBasicIOObtained(new FileProtocolBasicIO { auInfo = assetUnitInfo }); listener.OnFinish(); } } string[] assetRef = assetUnitInfo.reference.Split(':'); if (System.Collections.CaseInsensitiveComparer.Equals(assetRef[0], "folder://")) { } }
void AssetReferenceListener.OnBasicIOObtained(AssetUnitBasicIO referInterface) { clientListener.OnBasicIOObtained(referInterface); }