Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Resolved How to change the clip to BlobAsetReference Clip in release mode

Discussion in 'DOTS Animation' started by hokore, Dec 29, 2021.

  1. hokore

    hokore

    Joined:
    Dec 27, 2021
    Posts:
    3
    Hello, I am trying to make BlobAsetReference<Clip>.
    But release mode (like window standalone) cannot build.
    Is there a way to make BlobAsetReference<Clip> in release mode?

    Code (CSharp):
    1.  
    2. Assets\Scripts\Animation\PlayerAnimationAuthoring.cs(52,42): error CS1061: 'AnimationClip' does not contain a definition for 'ToDenseClip' and no accessible extension method 'ToDenseClip' accepting a first argument of type 'AnimationClip' could be found (are you missing a using directive or an assembly reference?)
    3.  
    upload_2021-12-29_14-13-49.png
     

    Attached Files:

  2. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    clip conversion relies on the editor at the moment(or maybe forever who knows), place your animated things inside of subscenes.
     
  3. hokore

    hokore

    Joined:
    Dec 27, 2021
    Posts:
    3
    I am converting animation clips on the script through the 'ToDenseClip' function.
    Can you tell me in detail about putting it in the sub scene?
     
  4. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    Subscenes are scenes which get converted in editor and stored on disk, so they can be loaded near instantly at play time. Both the animation samples and regular entity component system samples repos have many examples of subscene usage.
    In the screenshot you provided you can see the entire segment of code is surrounded by an editor #if so it will only work inside the editor, which forces you to use subscenes to "preconvert" any data before runtime ever happens.

    You should be able to rightclick a gameobject in the hierarchy, and select new subscene from selection or just new subscene which will automatically create one for you.
     
    hokore likes this.
  5. hokore

    hokore

    Joined:
    Dec 27, 2021
    Posts:
    3
    Thank you thelebaron :):):)
    As you answered, when I put the animation clip inside the sub-scene and used it, I took the corresponding entry and referred to the BlobAsetReference.

    upload_2022-1-3_14-40-56.png

    upload_2022-1-3_14-41-26.png
     

    Attached Files: