| Parameter | Description |
|---|---|
| typeName | The full type name of the replacement component including its namespace. |
| displayName | Optional display name to display in the Inspector button. If it's not specified, Unity derives a name from typeName. |
Initializes the attribute with the replacement type name and an optional display name.
When you annotate a deprecated component with this attribute, Unity displays a button on the component’s UI in the Inspector window. When you click this button, Unity adds an instance of the replacement component to the same GameObject.
using UnityEngine;
[System.ObsoleteAttribute("The ObsoleteMonoBehaviour component is deprecated.", false)] [ReplacementComponent("UnityEngine.Camera", "Example Component")] public class ObsoleteMonoBehaviour : MonoBehaviour {
}