docs.unity.cn
    Show / Hide Table of Contents

    Class TypeNameChangedAttribute

    This attribute is for when a class or struct name changes, so that the SerializableType module can find the type in this scenario. If a type name is changed without this attribute, then there may be errors.

    Inheritance
    Object
    Attribute
    TypeNameChangedAttribute
    Namespace: Mechatronics.SystemGraph
    Syntax
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = true)]
    public class TypeNameChangedAttribute : Attribute, _Attribute

    Constructors

    TypeNameChangedAttribute(String, String)

    Initializes the attribute

    Declaration
    public TypeNameChangedAttribute(string formerName, string formerNameSpace = null)
    Parameters
    Type Name Description
    String formerName

    What this type used to be known as, use the typename without any namespace

    String formerNameSpace

    The name of the OLD namespace, only required if the residing namespace changed.

    Fields

    formerTypeNameString

    The former type name string

    Declaration
    protected string formerTypeNameString
    Field Value
    Type Description
    String

    prefix

    The prefix

    Declaration
    protected string prefix
    Field Value
    Type Description
    String

    Methods

    GetFullName(String)

    Given the current full name, returns the full old full name.

    Declaration
    public string GetFullName(string newName)
    Parameters
    Type Name Description
    String newName

    Current full name for the type.

    Returns
    Type Description
    String

    If the type has not changed namespaces, then simply appends the type name to the given namespace. Otherwise gets full name with new namespace.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, October 18, 2022
    Terms of use