Exemplo n.º 1
0
 public void OnAfterDeserialize()
 {
     if (!string.IsNullOrEmpty(_serializedGraph))
     {
         Graph = GraphSerializer.Deserialize(_serializedGraph);
     }
 }
Exemplo n.º 2
0
        public override void OnImportAsset(AssetImportContext ctx)
        {
            var textGraph = File.ReadAllText(ctx.assetPath, Encoding.UTF8);

            var graph = GraphSerializer.Deserialize(textGraph);

            var graphAsset = GraphAsset.Create(graph);

            ctx.AddObjectToAsset("MainAsset", graphAsset);
            ctx.SetMainObject(graphAsset);
        }