Example #1
0
 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();
     }
 }
Example #2
0
 void AssetReferenceListener.OnFinish()
 {
     parent.finishCount++;
     if (localAssetInterface != null)
     {
         if (parent.CheckDependencyAndCollectInterface(localAssetInterface))
         {
             interfaceTaker.Take(localAssetInterface);
         }
     }
     interfaceTaker.OnFinish();
 }
Example #3
0
 void AsyncProcess.OnFinish()
 {
     interfaceTaker.OnFinish();
     if (success)
     {
         simpleListener.OnSuccess();
     }
     else
     {
         simpleListener.OnFail("Unknown");
     }
 }
Example #4
0
 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();
 }
Example #5
0
        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;
        }