call_deferred
addchild 는 _ready() 함수가 호출된 후에 호출되어야 한다고 한다. 그러나 _ready() 함수안에서 addchild를 사용하고 싶다면, call_deferred()를 이용하여 addchild를 사용할 수 있다.
(It is said that addchild must be called after the _ready() function is called. However, if you want to use addchild in the _ready() function, you can use addchild using call_deferred().)
목차
1. 사용법
2. instance object
3. 유니티 instance
4. Godot instance
----
----
how to use
parentNode.call_deferred("add_child", childLoad.instance())
instance object
유니티의 Instanciate와 비슷하게 사용할 수 있다.
(It can be used similarly to Unity’s Instanciate.)
유니티의 경우 (in unity)
var childload = Resources.Load("child");
var newChild = Instantiate(childload) as GameObject;
newChild.transform.SetParent(parentObj.transform);
Godot의 경우 (in godot)
var childObj = load("res://child.tscn")
var newChild = childObj.instance()
parentNode.add_child(newChild)
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' 카테고리의 다른 글
Godot(고닷), MoveToward 함수와 유도탄 구현(guided missile) (0) | 2024.04.01 |
---|---|
Godot(고닷), Scene change, reload etc with Unity (0) | 2024.03.17 |
Godot - Target Sdk 33 (0) | 2024.01.14 |
godot - Label click event (0) | 2022.02.09 |
Godot - 고닷을 이용한 json 데이터 컨버팅 ( godot json to object ) (0) | 2022.01.20 |