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

RefRO<T0>.IsValid

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

public bool IsValid;

Description

Property that returns true if the reference is valid, false otherwise.

This property does not take into account if the component is enabled or not.

This property is intended to indicate whether it is safe to read or write this reference's value. It is not safe to use this value as a synonym for "does the target entity have component T?". For zero-size "tag" components (which have no addressable value in chunk memory), IsValid will always return false, even if the component is present. It is safer to use existing HasComponent features to test for component presence.