[Tip] Unity2018 -> Unity2019로 갈 때 obsolate 관련 처리
Unity2018에서 Unity2019로 올려보면서 나오는 에러 정리
그렇게 큰 이슈는 없는 듯 하고, GUIText와 GUITexture가 obsolete 되면서 나온 이슈 뿐인 것 같다.
[Error:1] error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'
-> GUIText -> UnityEngine.UI.Text 로 변경
[Error:2-1] error CS0619: 'GUITexture' is obsolete: 'GUITexture has been removed. Use UI.Image instead.'
-> GUITexture -> UnityEngine.UI.Image 로 변경
[Error:2-2] 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?)
-> Texture2D를 Sprite로 변환해서 처리
public void CameraFadeAdd(Texture2D texture)
{
....
//Create Sprite from the Texture2D
Sprite tempSprite = Sprite.Create(texture, new Rect(0.0f, 0.0f, texture.width, texture.height), new Vector2(0.5f, 0.5f), 100.0f);
cameraFade.GetComponent().sprite = tempSprite;
....
}
[Error:2-2 참조] stackoverflow.com/questions/53491613/guitexture-is-deprecated-so-what-should-i-use-instead-of-it
[Error:3]
[해당 씬에 접근 했을 때 Error]
- Component GUI Layer in Main Camera for Scene Assets/Scenes/InGame.unity is no longer available. It will be removed after you edit this GameObject and save the Scene. UnityEditor.SceneManagement.EditorSceneManager:OpenScene(String)
[빌드 할 때 Error]
- Component GUI Layer in Main Camera for Scene Assets/Scenes/InGame.unity is no longer available. It will be removed after you edit this GameObject and save the Scene. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
- Component at index 2 could not be loaded when loading game object 'Main Camera'. Removing it!
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
-> 해당 Scene으로 가서 Hierarchy에서 임의 수정 후 Save 하면 해결 됨.
[Error:3 참조]
All of them can be ignored. Just open the scenes once and save them.
'Unity3D > Tips' 카테고리의 다른 글
[펌] 겔럭시 S10이상의 폰에서 게임화면이 하얗게 나오는 현상 (0) | 2021.02.05 |
---|---|
[펌] Unity에서 iOS와 Androd 런타임 권한 확인 요구하는 방법 (0) | 2020.10.26 |
[펌] Automatically set Hindi language in Unity (0) | 2020.09.15 |
[펌] Sqlite Insert 속도 문제시 (0) | 2020.08.05 |
[펌] [Unity] Android keystore 경로 상대경로로 지정하기 (0) | 2020.06.09 |