1. 程式人生 > 實用技巧 >一天一個小Bug supportstextureformatnative is not allowed to be called from a monobehaviour constructor

一天一個小Bug supportstextureformatnative is not allowed to be called from a monobehaviour constructor

supportstextureformatnative is not allowed to be called from a monobehaviour constructor

我呼叫我的 TextureKit的LoadTexture2DToList方法時候放在unity生命週期函式可以例如Start()或者是Awake()執行正常,如果是自己搞的其他東西里例如OnOpen()呼叫LoadTexture2DToList方法便會報上述錯誤

如圖所示: