Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

IRefCounted

interface in Unity.Entities

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

An interface for shared component types to inherit from. Whenever a IRefCounted shared component is added to a world, its Retain() method will be invoked. Similarly, when removed from a world, its Release() method will be invoked. This interface can be used to safely manage the lifetime of a shared component whose instance data is shared between multiple worlds.

Public Methods

Method Description
Release Called when a world has the last instance of a IRefCounted type removed from it.
Retain Called when a world has a new instance of a IRefCounted type added to it.

Delegates

Delegate Description
RefCountDelegate Delegate method used for invoking Retain() and Release() member functions from Burst compiled code.