Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

PhysicsHandleExtensions

class in Unity.U2D.Physics

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

Extensions that let a physics handle be written through when it is reached by something other than a plain variable.

C# refuses an assignment made through a property or indexer that returns a value type. That rules out writing a handle's properties at any such site, however the handle itself was obtained. Each extension here returns the handle from a method instead, which C# does accept as the target of a property assignment. Every handle is a read-only struct carrying nothing but the handle itself. The returned copy therefore addresses the same underlying object, and a property written through it takes effect exactly as if it had been written through a variable.

Static Methods

Method Description
Get Returns this world in a form that can be written through.