ReplacementComponentAttribute
Marks a deprecated component with a recommended replacement component type.
Read time 3 minutesLast updated 5 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
- Inherits from: Attribute
public class ReplacementComponentAttribute : Attribute
Remarks
Use this attribute on a component class to tell the Unity Editor which component should replace it.
When you apply this attribute to a deprecated component, the Inspector displays a helper button that lets users add the recommended replacement component to the same GameObject.
When you apply this attribute to a deprecated component, the Inspector displays a helper button that lets users add the recommended replacement component to the same GameObject.
Constructors
Constructor | Description |
|---|---|
| ReplacementComponentAttribute(System.String,System.String) | Initializes the attribute with the replacement type name and an optional display name. |
Properties
Property | Description |
|---|---|
| DisplayName | The name Unity displays for the replacement component in the Inspector. |
| TypeName | The full type name (including namespace) of the replacement component. |