UnityError The same field name is serialized multiple times in the class or its parent class. This is not supported: Base(MonoBehaviour) i


相同的字段名在類或其父類中被多次序列化。這是不支持的,

這里指的是 變量i .

寫如下兩個腳本掛到新項目的相機上運行就會出現這個問題:

public class Father : MonoBehaviour
{
    public int e;

    private void Start()
    {
        e = 1;
    }
}
public class Son : Father
{
    public int e;

    private void Start()
    {
        e = 2;
    }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM