void AssetReferInterface.PickContent <ContentType>(string path, Taker <ContentType> collector) { if (string.IsNullOrEmpty(path)) { if (typeof(ContentType) == typeof(MonoBAUICustomizer)) { basicAssetIO.assetOut.PickAssetAtPath("Customizer.prefab", new StdBridgeBasicColl <ContentType> { collector = collector }); } else if (typeof(ContentType) == typeof(MonoBAUIntegrator)) { basicAssetIO.assetOut.PickAssetAtPath("Integrator.prefab", new StdBridgeBasicColl <ContentType> { collector = collector }); } else { collector.None(); } } else { basicAssetIO.assetOut.PickAssetAtPath(path, new StdBridgeBasicColl <ContentType> { collector = collector }); } }
IEnumerator RemoteSPCo(string eWords, Taker <GrammarBlock> listener) { inteceptHelper.OnBeginSession(listener); var form = new WWWForm(); bool didCollect = false; form.AddBinaryData("ewords", System.Text.Encoding.UTF8.GetBytes(eWords)); UnityWebRequest www = UnityWebRequest.Post(uri, form); yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError) { Debug.Log("HTML_MonoBLProcessor: " + www.error); } else { Debug.Log(Encoding.UTF8.GetString(www.downloadHandler.data)); var gblock = RequiredFuncs.FromJson <DeserializedGBlock>(www.downloadHandler.data); listener.Take(gblock); didCollect = true; } inteceptHelper.OnEndSession(listener); if (!didCollect) { listener.None(); } }
void Taker <ContentType> .None() { if (enumerator.MoveNext()) { enumerator.Current.referer.PickContent(path, this); } else { clientTaker.None(); } }
void MorphemeAnalyzer.AnalyzeFormat(string naturalLanguage, Taker <DivisibleEnumerable <Morpheme> > listener) { var result = AnalyzeImmediate(naturalLanguage); if (result != null) { listener.Take(result); } else { listener.None(); } }
void AssetMediator.SeekAsset <ContentType>(GrammarBlock gBlock, Taker <ContentType> collLis) { var implementer = implementerGetter.assetImplGetter.GetAssetImplementer <ContentType>(gBlock); if (implementer != null) { implementer.SeekAsset(gBlock, new PrvtSeekLis <ContentType> { collLis = collLis, parent = this }); return; } //stub: should seek asset tool else { collLis.None(); } }
void AssetReferInterface.PickContent <ContentType>(string path, Taker <ContentType> collector) { if (typeof(ContentType) == typeof(byte[])) { var field = nameAndUIs.Find((item) => string.Compare(item.name, path, true) == 0); if (field != null) { if (!string.IsNullOrEmpty(field.inputField.text)) { collector.Take((ContentType)(object)System.Text.Encoding.UTF8.GetBytes(field.inputField.text)); return; } /*else { * tasks.Add(()=> { * collector.Take((ContentType)(object)System.Text.Encoding.UTF8.GetBytes(field.inputField.text)); * }); * return; * }*/ } } collector.None(); }
public static void DownloadAudio(string url, Taker <AudioClip> taker) { var downloadHandler = new DownloadHandlerAudioClip(string.Empty, AudioType.WAV); downloadHandler.streamAudio = true; var www = new UnityWebRequest(url, "GET", downloadHandler, null); ProcessWebRequest( www, (www2) => { var wwwe = www2; var content = DownloadHandlerAudioClip.GetContent(www); if (content != null) { taker.Take(content); return; } taker.None(); } ); }
void GrammarAnalyzer.AnalyzeGrammar(GAnlysInput input, Taker <GrammarBlock> listener) { var result = new ExpansiveMutableGBlock { metaForCluster = StdMetaInfos.sentenceCluster }; Action <GrammarBlock> adder = (gBlock) => result.AddBlock(gBlock); var nextInput = input; while (true) { //prepare analyzePreparer.Init(); foreach (var morpheme in nextInput.followings) { analyzePreparer.FeedMorpheme(morpheme); if (morpheme.id == 2) { break; } } var easyLis = new EasyIncrGAnalysListener { }; incrGAnalyzer.Analyze(nextInput, easyLis); if (!easyLis.didMatch) { break; } nextInput = easyLis.nextInput; easyLis.listener.OnResultRequested(adder); } if (result.content != null) { listener.Take(result); } else { listener.None(); } }
void AssetReferInterface.PickContent <ElementType>(string path, Taker <ElementType> collector) { if (string.IsNullOrEmpty(path)) { if (typeof(ElementType) == typeof(BaseMonoBType)) { basicAssetIO.assetOut.PickAssetAtPath(parent.mainAssetName, new StdBridgeBasicColl <GameObject> { collector = new PrvtMainColl { coll = new ToBaseTaker <BaseMonoBType, ElementType> { baseTaker = collector } } }); } else if (typeof(MonoBehaviour) == typeof(GameObject)) { basicAssetIO.assetOut.PickAssetAtPath(parent.mainAssetName, new StdBridgeBasicColl <ElementType> { collector = collector }); } else if (typeof(MonoBehaviour) == typeof(ElementType)) { basicAssetIO.assetOut.PickAssetAtPath("Dependencies.json", new StdBridgeBasicColl <ElementType> { collector = collector }); } else { collector.None(); } } else { basicAssetIO.assetOut.PickAssetAtPath(path, new StdBridgeBasicColl <ElementType> { collector = collector }); } }
/*string FindMainContent() { * foreach (var mainContentPath in basicAssetIO.assetOut.contentPaths) { * foreach (var postFix in parent.mainAssetPostfixs) { * if (mainContentPath.EndsWith(postFix, StringComparison.CurrentCultureIgnoreCase)) * return mainContentPath; * } * } * return null; * }*/ void AssetReferInterface.PickContent <ElementType>(string path, Taker <ElementType> collector) { if (string.IsNullOrEmpty(path)) { if (typeof(ElementType) == typeof(MainContentType)) { basicAssetIO.assetOut.PickAssetAtPath(parent.mainAssetName, new StdBridgeBasicColl <ElementType> { collector = collector }); } else if (typeof(ElementType) == typeof(MainContentBaseType)) { var toBaseTaker = new StdBridgeBasicColl <MainContentType> { collector = new ToBaseTaker <MainContentType, ElementType> { baseTaker = collector } }; basicAssetIO.assetOut.PickAssetAtPath(parent.mainAssetName, toBaseTaker); } else if (typeof(ElementType) == typeof(AssetRequest)) { basicAssetIO.assetOut.PickAssetAtPath("Dependencies.json", new StdBridgeBasicColl <ElementType> { collector = collector }); } else { collector.None(); } } else { basicAssetIO.assetOut.PickAssetAtPath(path, new StdBridgeBasicColl <ElementType> { collector = collector }); } }
void Taker <GameObject> .None() { coll.None(); }
void AssetBasicTaker <ContentType> .OnFinish() { collector.None(); }
void Taker <AssetType> .None() { externalTaker.None(); }
void Taker <AssetUnitInfo> .None() { auIntefaceTaker.None(); }
void Taker <IEnumerable <BehaverAgent> > .None() { taker.None(); }
void AvatarPhysicalizeInterface.Search(GrammarBlock attribute, Taker <IEnumerable <BehaverAgent> > asyncTaker) { asyncTaker.None(); }
void Taker <AssetUnitInterface> .None() { externalTaker.None(); }
void Taker <ContentType> .None() { clientColl.None(); }
void Taker <ItemType> .None() { clientTaker.None(); helper.CountDown(); }
void Taker <GrammarBlock> .None() { listener.None(); }