Search Unity

Anima2D gizmos visible in prefab mode

Discussion in 'Prefabs' started by codegasm, Jan 8, 2019.

  1. codegasm

    codegasm

    Joined:
    May 3, 2015
    Posts:
    38
    I am using Anima2D in my project. When I enter prefab mode I can still see the bone gizmos from my game inside the isolation mode. I have included an example below. I have dug into the issue from the Anima2D side of things as my first thought was to just disable the gizmo via the Unity interface. Unfortunately Anima2D renders it's gizmos in a non-standard way and the ability to hide the gizmos hasn't been implemented yet.

    Has anyone found a workaround for these bone gizmos being rendered inside the prefab mode despite not being part of the prefab?

     
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    There's no way I'm aware of that doesn't require modifying the plugin (Anima2D). You could try to ask them to update it.

    They could use the normal Gizmo approaches, or if they use a global callback where Camera-current can be relied on, then they can use this code to early out when the gizmos shouldn't be drawn:

    Code (CSharp):
    1. if (!StageUtility.IsGameObjectRenderedByCamera(gizmoGameObject, Camera.current))
    2.     return;
     
    codegasm likes this.
  3. codegasm

    codegasm

    Joined:
    May 3, 2015
    Posts:
    38
    That's exactly what I was looking for and it worked once I found the right places to put it. I don't mind patching my local version for now and I'll look into cleaning up my implementation and posting it in the Anima2D thread so Sergi_Valls can add it.

    Thanks!
     
    runevision likes this.