大家好,在我导入项目后,Unity 中不断出现此错误。
这是代码:
public static void CameraFadeSwap(Texture2D texture){
if(cameraFade){
cameraFade.GetComponent<Image>().texture=texture;
}
}
错误是:
Assets\Scripts\Utils\iTween.cs(6016,37): error CS1061: 'Image' does not contain a definition for 'texture' and no accessible extension method 'texture' accepting a first argument of type 'Image' could be found (are you missing a using directive or an assembly reference?)
如何修复?请回复。我是 Unity 的新手。谢谢