You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In IDE, I can use editorAsset through AssetReference, and there are no errors when loading scripts in IDE or Unity. However, during build, Unity prompts me that AssetReference does not include the definition of editorAsset
#90
Open
Mayfly777w opened this issue
Nov 29, 2023
· 1 comment
In IDE, I can use editorAsset through AssetReference, and there are no errors when loading scripts in IDE or Unity. However, during build, Unity prompts me that AssetReference does not include the definition of editorAsset
error CS1061: 'AssetReference' does not contain a definition for 'editorAsset' and no accessible extension method 'editorAsset' accepting a first argument of type 'AssetReference' could be found (are you missing a using directive or an assembly reference?)
(These words are translated through a translator)
The text was updated successfully, but these errors were encountered:
Hi!
I know it's been quite a while, but in case you're still looking for the answer, it's pretty simple: the editorAsset property is defined inside the #if UNITY_EDITOR section, so you get this error in runtime on your device, and also in the code copying process when the target is selected by yours.
Make sure you are using the API available on your device. In particular, outside of the editor (and in general in any other situation), the preferred way to get an asset would be to call LoadAssetAsync<TObject>().
In IDE, I can use editorAsset through AssetReference, and there are no errors when loading scripts in IDE or Unity. However, during build, Unity prompts me that AssetReference does not include the definition of editorAsset
error CS1061: 'AssetReference' does not contain a definition for 'editorAsset' and no accessible extension method 'editorAsset' accepting a first argument of type 'AssetReference' could be found (are you missing a using directive or an assembly reference?)
(These words are translated through a translator)

The text was updated successfully, but these errors were encountered: