1. Python에서는 type() 함수를 써서 변수 타입을 알아볼 수 있다. 그와 같은 함수가 typeof() 함수이다.


2. Python의 type() 함수와는 다르게, 변수 타입을 체크하기 위해서 별도의 조건문이나 조건식을 사용해야 한다.

예) print(typeof(a) == TYPE_VECTOR2)


 

<참고>
http://docs.godotengine.org/en/stable/classes/class_@gdscript.html#class-gdscript-typeof

+ Recent posts