Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

What does Unity.Animation.AddRef() do?

Discussion in 'Animation Previews' started by HeyZoos, May 8, 2020.

  1. HeyZoos

    HeyZoos

    Joined:
    Jul 31, 2016
    Posts:
    50
    Code (CSharp):
    1. namespace Unity.Animation
    2. {
    3.     public abstract class GraphSystemBase<TGraphTag> : JobComponentSystem, IGraphSystem<TGraphTag> where TGraphTag : struct, IGraphTag
    4.     {
    5.         protected GraphSystemBase();
    6.  
    7.         public NodeSet Set { get; }
    8.         public int RefCount { get; }
    9.         public TGraphTag Tag { get; }
    10.  
    11.         public void AddRef();
    12.         public void RemoveRef();
    13.         protected override void OnCreate();
    14.         protected override JobHandle OnUpdate(JobHandle inputDeps);
    15.         protected internal override void OnCreateForCompiler();
    16.     }
    17. }
    I see it used in the example code.


    Code (CSharp):
    1.     protected override void OnCreate()
    2.     {
    3.         base.OnCreate();
    4.         m_GraphSystem  = World.GetOrCreateSystem<TAnimationGraph>();
    5.         m_GraphSystem.AddRef();
    6.         m_GraphSystem.Set.RendererModel  = NodeSet.RenderExecutionModel.Islands;
     
  2. Radivarig

    Radivarig

    Joined:
    May 15, 2013
    Posts:
    122