Exemplo n.º 1
0
 public void OnEndAnalysis(AssemblyDefinition assemblyDefinition)
 {
     if (schema == null)
     {
         schema = ProjectUtility.GetProjectAsset <FieldOperationSchema>();
     }
     if (schema != null)
     {
         if (operations.IsEmpty())
         {
             schema.assemblyData.Remove(assembly);
         }
         else
         {
             schema.assemblyData[assembly] = operations;
         }
         schema.UpdateIndices();
         ProjectUtility.UpdateProjectAsset(schema);
     }
 }
 public static string WriteArtifact <TAction>(string artifactFile, ActionSchema actionSchema, FieldOperationSchema operationSchema, ActionAsset actionAsset, ActionDefinitionAsset actionDefinitionAsset) where TAction : Delegate
 {
     using var blob = Create <TAction>(actionAsset.CreateModel(), actionSchema, operationSchema, actionDefinitionAsset, Unity.Collections.Allocator.Temp);
     return(DoWriteArtifact <TAction>(artifactFile, blob));
 }
 public unsafe static BlobAssetReference <ActionGraph <TAction> > Create <TAction>(ActionAssetModel model, ActionSchema actionSchema, FieldOperationSchema operationSchema, ActionDefinitionAsset definitionAsset, Allocator allocator = Allocator.Persistent) where TAction : Delegate
 {
     FormatData(model, definitionAsset, operationSchema, actionSchema, out var nodes, out var variables, out var roots, out var configLength, out var actionNodeCount, out var fieldOperationNodeCount);
     Type    variableType        = definitionAsset.variableType.IsCreated ? definitionAsset.variableType.Value : null;
     var     memoryMap           = GetConfigMemoryMap(nodes, variableType);
     var     builder             = new BlobBuilder(Unity.Collections.Allocator.Temp);
     ref var root                = ref builder.ConstructRoot <ActionGraph <TAction> >();
        public unsafe static UnsafeUntypedBlobAssetReference CreateUntyped <TAction>(ActionAssetModel model, ActionSchema actionSchema, FieldOperationSchema operationSchema, ActionDefinitionAsset definitionAsset, Allocator allocator = Allocator.Persistent) where TAction : Delegate
        {
            var blob = Create <TAction>(model, actionSchema, operationSchema, definitionAsset, allocator);

            return(UnsafeUntypedBlobAssetReference.Create(blob));
        }
 public unsafe static UnsafeUntypedBlobAssetReference CreateUntyped(ActionAssetModel model, ActionSchema actionSchema, FieldOperationSchema operationSchema, ActionDefinitionAsset definitionAsset, Allocator allocator = Allocator.Persistent)
 {
     return((UnsafeUntypedBlobAssetReference)typeof(ActionGraphSerializer).GetGenericMethod(nameof(ActionGraphSerializer.CreateUntyped), BindingFlags.Static | BindingFlags.Public).MakeGenericMethod(definitionAsset.delegateType).Invoke(null, new object[] { model, actionSchema, operationSchema, definitionAsset, Allocator.Temp }));
 }