Search Unity

ExposedReference docs doesn't compile - uses internal API?

Discussion in 'Documentation' started by Baste, Jan 9, 2018.

  1. Baste


    Jan 24, 2013
    The ExposedReference API looks really neat. The example code has two glaring errors, though;

    Code (csharp):
    1. public class CameraSwitcher : StandardAsset
    I have no idea what StandardAsset is. I can't find it in any docs, and my editor can't find it. It's not even there if I search through the sources with ILSpy. Is this just a mess up, or is StandardAsset a part of some package?

    The second error:

    Code (csharp):
    1. frameData.exposedPropertyResolver
    Playables.FrameData has no field or property named "exposedPropertyResolver", so that won't compile either. Is the documentation using features that hasn't made it into the main release?

    I'm also confused about this:

    I tried setting up a test asset:

    Code (csharp):
    2. using UnityEngine;
    4. [CreateAssetMenu]
    5. public class TestObjectReference : ScriptableObject {
    7.     public ExposedReference<Camera> camera;
    9. }
    I created one, and tried to assign a camera from a scene to it. No luck - it only accepts assets. So that doesn't work.

    I'm also confused about IExposedPropertyTable. It seems like the only one that exists is the one returned by PlayableGraph.GetResolver. So there seems to be no way for us to resolve objects in a scene by default.

    From what I can tell, this system only works in the context of the Playables system somehow. Is this how Timeline links scene objects to assets behind the scene, perhaps? Anyway, the docs state that they're supposed to work together with ScriptableObjects. Is that wrong?

    Are we supposed to create our own subclass of ExposedReference, together with a drawer, and implement our own IExposedPropertyTable for each scene? That's doable, but somewhat reduces the coolness of the system - I could make something like that already.
    Xarbrough likes this.
  2. don_unity959


    Unity Technologies

    Oct 19, 2017
    Thanks for letting us know. Your report has been forwarded to the person who updates that content and she has put it in the queue.