別アセンブリで定義されたUniTyped付きの型にアクセスできない点
Opened this issue · 2 comments
Deleted user commented
いつも便利に使わせて頂いております。
本ライブラリに関してアセンブリを切り分けた際に発生する不具合を見つけたので再現方法を記載させて頂きます。
環境
- Unity 2022.2.17f1
再現方法
1. アセンブリAでUniTyped属性付きのSampleModel
クラスを定義します
using System;
using UniTyped;
namespace A
{
[UniTyped]
[Serializable]
public class SampleModel
{
}
}
2. アセンブリBでSampleModel
型のシリアライズ可能なフィールドを持ったHoge
クラスをUniTyped属性付きで定義します
using System;
using A;
using UniTyped;
namespace B
{
[UniTyped]
[Serializable]
public class Hoge
{
public SampleModel SampleModel;
}
}
3. アセンブリB側で生成されたHogeView
構造体をインスタンス化し、SampleModel
プロパティにアクセスするコードを記述します
using System;
using A;
using UniTyped;
using UniTyped.Generated.B;
namespace B
{
[UniTyped]
[Serializable]
public class Hoge
{
public SampleModel SampleModel;
private static void Start()
{
HogeView view = new();
var temp = view.SampleModel;
}
}
}
4. Unity Editor上に戻るとコンパイルが走り、コンパイルエラーとなります。その際のエラーメッセージは以下のとおりです。
Assets/B/Hoge.cs(17,29): error CS1061: 'HogeView' does not contain a definition for 'SampleModel' and no accessible extension method 'SampleModel' accepting a first argument of type 'HogeView' could be found (are you missing a using directive or an assembly reference?)
shunsuke-saito-mummy commented
修正確認できました!ご対応頂きありがとうございます!