static DisplayInfo ForType( System.Type t, bool inherit )

book_4_sparkGenerated
code_blocksInput

Description

The ForType method in the DisplayInfo struct is a static method that retrieves display information for a specified type. This method collects relevant information such as description, name, icon, and other attributes associated with the type. It can also consider inherited attributes if specified.

Usage

To use the ForType method, you need to provide the type for which you want to retrieve display information and a boolean indicating whether to include inherited attributes.

Parameters:

  • t (System.Type): The type for which display information is to be retrieved.
  • inherit (System.Boolean): A boolean value indicating whether to include inherited attributes in the display information.

Returns: A DisplayInfo object containing the collected display information for the specified type.

Example

// Example of using DisplayInfo.ForType
Type myType = typeof(MyCustomClass);
bool includeInherited = true;
DisplayInfo info = DisplayInfo.ForType(myType, includeInherited);

// Accessing some properties of the DisplayInfo
string className = info.ClassName;
string description = info.Description;
string icon = info.Icon;

// Output the information
// Note: Use appropriate methods to display or log the information
// e.g., Debug.Log(className);