void SyntacticProcessor.PerformSyntacticProcess(byte[] behaviorExpression, Taker <GrammarBlock> listener) { try { System.IntPtr marshalArray = Marshal.AllocHGlobal(behaviorExpression.Length); Marshal.Copy(behaviorExpression, 0, marshalArray, behaviorExpression.Length); var gBlockPtr = PerformSyntacticProcess(fAnalyser.implPtr, gAnalyser.implPtr, marshalArray, behaviorExpression.Length); Marshal.FreeHGlobal(marshalArray); listener.Take(NativeGrammarBlockUtils.GBlockPtrToGBlock(gBlockPtr)); listener.OnFinish(); } catch (Exception e) { Debug.Log(e); listener.OnFinish(); } }
void AssetReferenceListener.OnFinish() { parent.finishCount++; if (localAssetInterface != null) { if (parent.CheckDependencyAndCollectInterface(localAssetInterface)) { interfaceTaker.Take(localAssetInterface); } } interfaceTaker.OnFinish(); }
void AsyncProcess.OnFinish() { interfaceTaker.OnFinish(); if (success) { simpleListener.OnSuccess(); } else { simpleListener.OnFail("Unknown"); } }
void BasicAssetOut.PickAssetAtPath <ElementType>(string path, Taker <ElementType> collector) { try { var contentFullPath = Path.GetDirectoryName(assetUnitInfo.localref) + "/" + path; if (typeof(ElementType) == (typeof(ModelImporter))) { var importer = (ElementType)(object)ModelImporter.GetAtPath(contentFullPath); collector.Take(importer); } else if (typeof(UnityEngine.Object).IsAssignableFrom(typeof(ElementType))) { try { foreach (var asset in AssetDatabase.LoadAllAssetsAtPath(contentFullPath)) { try { var concreteAsset = (ElementType)(object)asset; if (concreteAsset != null) { collector.Take(concreteAsset); break; } } catch { } } } catch { collector.OnFail("StdEditTimeUnityAssetIO.PickAssetAtPath: "); } } else { if (File.Exists(contentFullPath)) { collector.Take(RequiredFuncs.FromJsonAtPath <ElementType>(contentFullPath)); } } } catch (Exception e) { Debug.LogError(e); } collector.OnFinish(); }
void CheckDependencyAndCollectInterface(AssetUnitInfo assetUnitInfo, Taker <AssetInterface> collector, bool doAddToLocalItfcDbs = false) { var customItfc = customAssetInterfaceGiver[AssetUtils.GetPrimalType(assetUnitInfo)]; if (customItfc != null) { var localAssetInterface = customItfc.PickBestElement(new StdEditTimeUnityAssetIO { assetUnitInfo = assetUnitInfo }); if (doAddToLocalItfcDbs) { localizedAssetInfoColl.Take(assetUnitInfo); } if (CheckDependencyAndCollectInterface(localAssetInterface)) { collector.Take(localAssetInterface); } } finishCount++; collector.OnFinish(); return; }