목차
1. 씬 전환 (scene change)
2. 씬 다시 호출 (reload scene)
3. 앱 종료 (app quit)
----
----
Scene change
get_tree().change_scene("res://scene.tscn")
[ in Unity ]
SceneManager.LoadScene("sceneName");
reload scene
get_tree().reload_current_scene()
[ in Unity ]
SceneManager.LoadScene("sceneName");
app Quit
get_tree().quit()
※ IOS에서는 작동하지 않는다 (Ios not working)
IOS에서는 홈 화면으로 돌아갔을 때 필요한 처리를 해주면 된다.
(In iOS, you can do the necessary processing when you return to the home screen.)
홈 화면으로 나갔는지 확인하기 위한 이벤트함수
(Event function to check whether you have gone to the home screen)
func _notification(what):
if what == MainLoop.NOTIFICATION_WM_FOCUS_IN:
print("NOTIFICATION_WM_FOCUS_IN")
elif what == MainLoop.NOTIFICATION_WM_FOCUS_OUT:
print("NOTIFICATION_WM_FOCUS_OUT")
※ 주의할 점 (caution)
Admob을 사용할 때 전면광고에 진입하여도 _notification 함수가 호출되니 주의가 필요하다.
(When using admob, you need to be careful because the _notification function is called even if you enter a full-page advertisement.)
[ in Unity ]
Application.Quit();
Godot, error Parent node is busy setting up children (addchild)
call_deferred addchild 는 _ready() 함수가 호출된 후에 호출되어야 한다고 한다. 그러나 _ready() 함수안에서 addchild를 사용하고 싶다면, call_deferred()를 이용하여 addchild를 사용할 수 있다. (It is said that addch
moblieandlife.tistory.com
Godot - Target Sdk 33
Godot 프로젝트의 안드로이드 Target Sdk 를 33으로 승급시키는 과정에서 발생한 시행 착오를 정리해 본다 ---- ---- 1. JDK android 폴더의 config.gradle 을 확인 해 보면 java 의 버전이 나오니 해당하는 jdk를
moblieandlife.tistory.com
godot - Label click event
---- ----
moblieandlife.tistory.com
Godot - 고닷을 이용한 json 데이터 컨버팅 ( godot json to object )
개발환경 : MAC 버전 : godot 3.3.2 ---- ---- 코딩을 하다보면 반드시 마주치는 과정 중의 하나인 json 데이터를 오브젝트 형식으로 변경하기 입니다. 특히 서버 데이터를 json 형식으로 받았을 때 주로
moblieandlife.tistory.com
'Programming' 카테고리의 다른 글
소스트리가 갑자기 실행되지 않을 때 (sourcetree not woring) (0) | 2024.04.26 |
---|---|
Godot(고닷), MoveToward 함수와 유도탄 구현(guided missile) (0) | 2024.04.01 |
Godot(고닷), error Parent node is busy setting up children (addchild) (0) | 2024.03.17 |
Godot - Target Sdk 33 (0) | 2024.01.14 |
godot - Label click event (0) | 2022.02.09 |