Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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:
    110