mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
93c84650cd
This also simplifies some functions. This partially addresses #30.
16 lines
385 B
GDScript
16 lines
385 B
GDScript
tool
|
|
extends Node
|
|
|
|
var includes
|
|
|
|
func create_node(type) -> Node:
|
|
var node = null
|
|
var file_name = "res://addons/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://addons/material_maker/nodes/generic.tscn").instance()
|
|
return node
|