Search Unity

Instantiate a prefab from a yaml text stream

Discussion in 'Scripting' started by KevinW, Apr 12, 2016.

  1. KevinW

    KevinW

    Joined:
    Mar 23, 2014
    Posts:
    5
    In order to support "faster than Asset Bundling workflow", I want to provide .prefab files to my client over the air. Assume the prefab was authored within unity and its contents are then passed to the client at runtime through an AJAX (www) response. The payload the client receives from such a request would be the exact text within a serialized (YAML) .prefab file. From there, I would like to instantiate that text stream just as I would a Resource loaded from within the project. For consideration, I've already thought of writing the text stream out to a temporaryCachePath file and then trying to load it from there. But, even if I got that to work, the performance of such an abomination would be unacceptable.

    I also understand that this functionality is the whole point of Asset Bundles, but my project, team, and technology amount to full dev-day's worth of effort from 3 resources in order to deploy a single Asset Bundle to our live servers. The proposed workflow that I am working towards would amount to just a couple hours from 1 resource to accomplish the same tasks using Asset Bundles.
     
  2. KevinW

    KevinW

    Joined:
    Mar 23, 2014
    Posts:
    5
    How about help with deserializing the entire YAML payload, myself, which is likely what I would have to do... anyone have any guidance to that end?