0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Unity] クラス名を変更してもSerializeReferenceの参照が消えないようにする

Last updated at Posted at 2024-08-03

結論

クラスにUnityEngine.Scripting.APIUpdating.MovedFrom属性を付与してから改名すればよさそう。

使用例

名前空間・アセンブリが変わらない場合

[UnityEngine.Scripting.APIUpdating.MovedFrom(true, sourceClassName: "HogeClass")]

sourceClassNameに改名前のクラス名を指定する。

名前空間・アセンブリが変わる場合

[UnityEngine.Scripting.APIUpdating.MovedFrom(true, "HogeNamespace", "Assembly-Hoge", "HogeClass")]

同様にsourceNamespacesourceAssemblyに改名前の名称を指定すればOK。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?