summaryrefslogtreecommitdiff
path: root/Samples/Hello/scripts/material_loader.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Samples/Hello/scripts/material_loader.lua')
-rw-r--r--Samples/Hello/scripts/material_loader.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/Samples/Hello/scripts/material_loader.lua b/Samples/Hello/scripts/material_loader.lua
new file mode 100644
index 0000000..628ca3b
--- /dev/null
+++ b/Samples/Hello/scripts/material_loader.lua
@@ -0,0 +1,16 @@
+local MaterialLoader = AsuraEngine.Importer.New("material")
+local MaterialManager = require "MaterialManager.lua"
+
+function MaterialLoader.Load(mat)
+ local shader = AsuraEngine.Shader.GetShader(mat.shader)
+ if shader == nil then
+ shader = AsuraEngine.Shader.New(mat.shader)
+ if shader == nil then
+ return nil
+ end
+ end
+ local material = AsuraEngine.Class()
+ return material
+end
+
+return MaterialLoader \ No newline at end of file