mirror of
https://github.com/Relintai/material-maker.git
synced 2024-12-27 23:17:14 +01:00
15 lines
366 B
GDScript
15 lines
366 B
GDScript
extends Node
|
|
|
|
var includes
|
|
|
|
func create_node(type) -> Node:
|
|
var node = null
|
|
var file_name = "res://material_maker/nodes/"+type+".tscn"
|
|
if ResourceLoader.exists(file_name):
|
|
var node_type = load(file_name)
|
|
if node_type != null:
|
|
node = node_type.instance()
|
|
if node == null:
|
|
node = preload("res://material_maker/nodes/generic.tscn").instance()
|
|
return node
|