Extension Methods

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
(C#)
m (Updated page links and improved text.)
Line 19: Line 19:
 
   |}
 
   |}
 
   
 
   
Extension methods extend existing functionality to existing types.   
+
Extension methods extend functionality of existing types.   
  
== C# ==
 
 
*[[EditorGUIExtension]] - Some extensions to make coding the GUI for utilities/custom inspectors easier.
 
*[[EditorGUIExtension]] - Some extensions to make coding the GUI for utilities/custom inspectors easier.
*[[EnumExtensions]] - This script provides an instance TryParse method for .Net's System.Enum class.
+
*[[Enum.TryParse]] - Provides an instance TryParse method for enumerations.
*[[GenericMenuExtensions]] - Extension methods allowing you to cleanly add items to GenericMenu instances using chained method calls.
+
*[[GenericMenuExtensions]] - Allows you to cleanly add items to GenericMenu instances using chained method calls.
*[[GetOrAddComponent]] - Simple method extension to save 2 or 3 lines of very redundant and ugly code. It will check if component exists before adding new one.  
+
*[[GetOrAddComponent]] - Simple extension to save 2 or 3 lines of very redundant and ugly code.
*[[IsVisibleFrom]] - This C# class gives simple extension access to checking if an Renderer is rendered by a specific Camera.  
+
*[[IsVisibleFrom]] - For checking if a Renderer is rendered by a specific Camera.  
*[[LayerMaskExtensions]] - This C# class gives simple extension access to manipulating and debugging LayerMasks.  
+
*[[LayerMaskExtensions]] - For manipulating and debugging LayerMasks.  
*[[QuaternionExtensions]] - This script provide a few useful extensions to the inbuilt 'Quaternion' struct.  
+
*[[QuaternionExtensions]] - Provides a few useful extensions to the 'Quaternion' struct.  
*[[TextureFloodFill]] - Two extension methods for Texture2D which allows you to perform a floodfill operation on the texture.
+
*[[TextureFloodFill]] - Two methods for Texture2D which allows you to perform a floodfill operation on the texture.
 
|}
 
|}
<div style="border:2px solid #A3B1BF;padding:.5em 1em 1em 1em; border-top:none; border-bottom:2px solid #A3B1BF;  border-right:2px solid #A3B1BF; background-color:#ffffff; color:#000;">
 
  
</div>
 
  
 
[[Category:.NET Plugins]]
 
[[Category:.NET Plugins]]
 
[[Category:Native Code Plugins]]
 
[[Category:Native Code Plugins]]

Revision as of 20:16, 7 February 2019

Plugins   Extension Methods   Packages

Extension methods extend functionality of existing types.

  • EditorGUIExtension - Some extensions to make coding the GUI for utilities/custom inspectors easier.
  • Enum.TryParse - Provides an instance TryParse method for enumerations.
  • GenericMenuExtensions - Allows you to cleanly add items to GenericMenu instances using chained method calls.
  • GetOrAddComponent - Simple extension to save 2 or 3 lines of very redundant and ugly code.
  • IsVisibleFrom - For checking if a Renderer is rendered by a specific Camera.
  • LayerMaskExtensions - For manipulating and debugging LayerMasks.
  • QuaternionExtensions - Provides a few useful extensions to the 'Quaternion' struct.
  • TextureFloodFill - Two methods for Texture2D which allows you to perform a floodfill operation on the texture.
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox