예제 #1
0
 public void OnAfterDeserialize()
 {
     if (!string.IsNullOrEmpty(_serializedGraph))
     {
         Graph = GraphSerializer.Deserialize(_serializedGraph);
     }
 }
예제 #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);
        }