summaryrefslogtreecommitdiff
path: root/Source/Asura.Framework/scripts
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-01-31 09:06:15 +0800
committerchai <chaifix@163.com>2019-01-31 09:06:15 +0800
commitc581dfbf1e849f393861d15e82aa6446c0c1c310 (patch)
tree2df779ba98acdd04a4b52f6bff0de143dfba4600 /Source/Asura.Framework/scripts
parentfc1713e9df3ae8db6e612610023e7bd5f6b6f5fe (diff)
*misc
Diffstat (limited to 'Source/Asura.Framework/scripts')
-rw-r--r--Source/Asura.Framework/scripts/ai/behavior_tree.lua0
-rw-r--r--Source/Asura.Framework/scripts/ai/state_machine.lua6
-rw-r--r--Source/Asura.Framework/scripts/ai/state_map.lua12
-rw-r--r--Source/Asura.Framework/scripts/audio/sound.lua9
-rw-r--r--Source/Asura.Framework/scripts/audio/source.lua22
-rw-r--r--Source/Asura.Framework/scripts/class.lua19
-rw-r--r--Source/Asura.Framework/scripts/component.lua30
-rw-r--r--Source/Asura.Framework/scripts/filesystem/animation_loader.lua10
-rw-r--r--Source/Asura.Framework/scripts/filesystem/asset.lua20
-rw-r--r--Source/Asura.Framework/scripts/filesystem/entity_loader.lua5
-rw-r--r--Source/Asura.Framework/scripts/filesystem/image_loader.lua13
-rw-r--r--Source/Asura.Framework/scripts/filesystem/loader.lua12
-rw-r--r--Source/Asura.Framework/scripts/filesystem/material_loader.lua7
-rw-r--r--Source/Asura.Framework/scripts/filesystem/path_loader.lua9
-rw-r--r--Source/Asura.Framework/scripts/filesystem/scene_loader.lua7
-rw-r--r--Source/Asura.Framework/scripts/filesystem/script_loader.lua5
-rw-r--r--Source/Asura.Framework/scripts/filesystem/shader_loader.lua5
-rw-r--r--Source/Asura.Framework/scripts/filesystem/statemap_loader.lua7
-rw-r--r--Source/Asura.Framework/scripts/framework.lua2
-rw-r--r--Source/Asura.Framework/scripts/gameobject.lua115
-rw-r--r--Source/Asura.Framework/scripts/graphics/animation.lua15
-rw-r--r--Source/Asura.Framework/scripts/graphics/animator.lua31
-rw-r--r--Source/Asura.Framework/scripts/graphics/camera.lua21
-rw-r--r--Source/Asura.Framework/scripts/graphics/canvas.lua34
-rw-r--r--Source/Asura.Framework/scripts/graphics/default_shaders.lua5
-rw-r--r--Source/Asura.Framework/scripts/graphics/image.lua38
-rw-r--r--Source/Asura.Framework/scripts/graphics/material.lua47
-rw-r--r--Source/Asura.Framework/scripts/graphics/material_manager.lua3
-rw-r--r--Source/Asura.Framework/scripts/graphics/mesh2d.lua9
-rw-r--r--Source/Asura.Framework/scripts/graphics/mesh2d_renderer.lua13
-rw-r--r--Source/Asura.Framework/scripts/graphics/particle_system.lua20
-rw-r--r--Source/Asura.Framework/scripts/graphics/renderer.lua19
-rw-r--r--Source/Asura.Framework/scripts/graphics/shader.lua43
-rw-r--r--Source/Asura.Framework/scripts/graphics/shape.lua12
-rw-r--r--Source/Asura.Framework/scripts/graphics/shape_renderer.lua13
-rw-r--r--Source/Asura.Framework/scripts/graphics/sprite.lua10
-rw-r--r--Source/Asura.Framework/scripts/graphics/sprite_batch_renderer.lua9
-rw-r--r--Source/Asura.Framework/scripts/graphics/sprite_renderer.lua14
-rw-r--r--Source/Asura.Framework/scripts/gui/button.lua21
-rw-r--r--Source/Asura.Framework/scripts/gui/text.lua0
-rw-r--r--Source/Asura.Framework/scripts/managers/scene_manager.lua16
-rw-r--r--Source/Asura.Framework/scripts/managers/sprite_manager.lua0
-rw-r--r--Source/Asura.Framework/scripts/math/curve.lua0
-rw-r--r--Source/Asura.Framework/scripts/path/path.lua13
-rw-r--r--Source/Asura.Framework/scripts/path/path_calculator.lua12
-rw-r--r--Source/Asura.Framework/scripts/path/path_manager.lua0
-rw-r--r--Source/Asura.Framework/scripts/scene.lua21
-rw-r--r--Source/Asura.Framework/scripts/transform.lua9
48 files changed, 763 insertions, 0 deletions
diff --git a/Source/Asura.Framework/scripts/ai/behavior_tree.lua b/Source/Asura.Framework/scripts/ai/behavior_tree.lua
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Source/Asura.Framework/scripts/ai/behavior_tree.lua
diff --git a/Source/Asura.Framework/scripts/ai/state_machine.lua b/Source/Asura.Framework/scripts/ai/state_machine.lua
new file mode 100644
index 0000000..b1ff849
--- /dev/null
+++ b/Source/Asura.Framework/scripts/ai/state_machine.lua
@@ -0,0 +1,6 @@
+local StateMachine = Class()
+AsuraEngine.StateMachine = StateMachine
+
+function StateMachine.Ctor(self, statemap)
+ self.statemap = statemap
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/ai/state_map.lua b/Source/Asura.Framework/scripts/ai/state_map.lua
new file mode 100644
index 0000000..7e986de
--- /dev/null
+++ b/Source/Asura.Framework/scripts/ai/state_map.lua
@@ -0,0 +1,12 @@
+local StateMap = AsuraEngine.Asset.Sub("StateMap")
+
+AsuraEngine.StateMap = StateMap
+
+function StateMap.Ctor(self)
+
+end
+
+function StateMap.ToAsset()
+
+end
+
diff --git a/Source/Asura.Framework/scripts/audio/sound.lua b/Source/Asura.Framework/scripts/audio/sound.lua
new file mode 100644
index 0000000..71def66
--- /dev/null
+++ b/Source/Asura.Framework/scripts/audio/sound.lua
@@ -0,0 +1,9 @@
+AsuraEngine.Sound = AsuraEngine.Asset.Sub("Sound")
+
+local Sound = AsuraEngine.Sound
+
+function Sound.Ctor(self)
+
+end
+
+return Sound \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/audio/source.lua b/Source/Asura.Framework/scripts/audio/source.lua
new file mode 100644
index 0000000..ccbc946
--- /dev/null
+++ b/Source/Asura.Framework/scripts/audio/source.lua
@@ -0,0 +1,22 @@
+-- Audio Source
+AsuraEngine.Source = AsuraEngine.Component.Sub("SoundPlayer")
+
+local Source = AsuraEngine.Source
+
+function Source.Ctor(self)
+ self.mSound = nil
+end
+
+function Source.SetSound(sound)
+ self.mSound = sound
+end
+
+function Source.GetSource()
+ return self.mSound
+end
+
+function Source.OnUpdate(dt)
+
+end
+
+return Source \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/class.lua b/Source/Asura.Framework/scripts/class.lua
new file mode 100644
index 0000000..1d60d3c
--- /dev/null
+++ b/Source/Asura.Framework/scripts/class.lua
@@ -0,0 +1,19 @@
+AsuraEngine.Class = {}
+
+local Class = AsuraEngine.Class
+Class.__index = Class
+
+function Class.Sub(base, classname)
+ local subclass = {}
+ base.__index = base
+ setmetatable(subclass, base)
+ return c
+end
+
+function Class.New(cls)
+ local obj = {}
+ setmetatable(obj, cls)
+ cls.__index = cls
+end
+
+
diff --git a/Source/Asura.Framework/scripts/component.lua b/Source/Asura.Framework/scripts/component.lua
new file mode 100644
index 0000000..ad29efa
--- /dev/null
+++ b/Source/Asura.Framework/scripts/component.lua
@@ -0,0 +1,30 @@
+AsuraEngine.Component = AsuraEngine.Class("Component")
+
+local Component = AsuraEngine.Component
+
+-- Component要显示在inspector的变量
+Component.gameobject = AsuraEngine.Type.GameObject
+
+function Component.Sub(cname)
+ self.base(cname)
+ assert(Component.components[cname] == nil)
+
+end
+
+function Component:Ctor(gameobject)
+ self.gameobject = gameobject
+end
+
+function Component:OnEvent(e)
+
+end
+
+function Component:OnUpdate(ms)
+
+end
+
+function Component:OnDraw()
+
+end
+
+return Component \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/filesystem/animation_loader.lua b/Source/Asura.Framework/scripts/filesystem/animation_loader.lua
new file mode 100644
index 0000000..c6808c0
--- /dev/null
+++ b/Source/Asura.Framework/scripts/filesystem/animation_loader.lua
@@ -0,0 +1,10 @@
+require "AnimationManager"
+require "Animation"
+
+local loader = AsuraEngine.Loader.New("animation")
+local manager = AsuraEngine.AnimationManager
+local Animation = AsuraEngine.Animation
+
+function AnimationLoader.Load(asset)
+ local animation = AsuraEngine.Class()
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/filesystem/asset.lua b/Source/Asura.Framework/scripts/filesystem/asset.lua
new file mode 100644
index 0000000..afe4ea6
--- /dev/null
+++ b/Source/Asura.Framework/scripts/filesystem/asset.lua
@@ -0,0 +1,20 @@
+--
+-- 游戏资源类需要继承Asset类,引擎读取.asset文件寻找对应的loader加载进游戏生成对应的Asset派生类对象。对于脚本,不会
+-- 生成对应的对象,而是直接运行脚本将结果保存。
+--
+AsuraEngine.Asset = AsuraEngine.Class("Asset")
+
+local Asset = AsuraEngine.Asset
+
+function Asset.Ctor(self)
+ self.guid = nil
+end
+
+--获得资源编号
+function Asset.GetGUID(self)
+
+end
+
+function Asset.GetAssetByGUID(guid)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/filesystem/entity_loader.lua b/Source/Asura.Framework/scripts/filesystem/entity_loader.lua
new file mode 100644
index 0000000..771f86a
--- /dev/null
+++ b/Source/Asura.Framework/scripts/filesystem/entity_loader.lua
@@ -0,0 +1,5 @@
+local loader = AsuraEngine.Loader.New("gameobject")
+
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/filesystem/image_loader.lua b/Source/Asura.Framework/scripts/filesystem/image_loader.lua
new file mode 100644
index 0000000..174d837
--- /dev/null
+++ b/Source/Asura.Framework/scripts/filesystem/image_loader.lua
@@ -0,0 +1,13 @@
+require "graphics.image"
+local loader = AsuraEngine.Loader.New("image")
+
+function loader.Load(asset)
+ assert(asset ~= nil)
+ local path = asset.extern
+ local image = AusraEngine.Image.New(path)
+ if image == nil then
+ AsuraEngine.LogError("")
+ return
+ end
+ return image
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/filesystem/loader.lua b/Source/Asura.Framework/scripts/filesystem/loader.lua
new file mode 100644
index 0000000..c7b8b8a
--- /dev/null
+++ b/Source/Asura.Framework/scripts/filesystem/loader.lua
@@ -0,0 +1,12 @@
+-- Assets loaders
+AsuraEngine.Loader = {}
+local Loader = AsuraEngine.Loader
+Loader.Loaders = {}
+
+function Loader.New(type)
+ assert(Loader.Loaders[type] == nil)
+ local loader = {}
+ Loader[type] = loader
+ return loader
+end
+
diff --git a/Source/Asura.Framework/scripts/filesystem/material_loader.lua b/Source/Asura.Framework/scripts/filesystem/material_loader.lua
new file mode 100644
index 0000000..2c2058e
--- /dev/null
+++ b/Source/Asura.Framework/scripts/filesystem/material_loader.lua
@@ -0,0 +1,7 @@
+require "MaterialManager"
+
+local loader = AsuraEngine.Loader.New("material")
+
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/filesystem/path_loader.lua b/Source/Asura.Framework/scripts/filesystem/path_loader.lua
new file mode 100644
index 0000000..8618c03
--- /dev/null
+++ b/Source/Asura.Framework/scripts/filesystem/path_loader.lua
@@ -0,0 +1,9 @@
+require "Path/PathManager"
+
+local loader = AsuraEngine.Loader.New("path")
+
+function loader.Load(asset)
+ if asset.type ~= "path" then
+ return nil
+ end
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/filesystem/scene_loader.lua b/Source/Asura.Framework/scripts/filesystem/scene_loader.lua
new file mode 100644
index 0000000..c0a951f
--- /dev/null
+++ b/Source/Asura.Framework/scripts/filesystem/scene_loader.lua
@@ -0,0 +1,7 @@
+local Scene = require "scene"
+
+local loader = AsuraEngine.Loader.New("scene")
+
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/filesystem/script_loader.lua b/Source/Asura.Framework/scripts/filesystem/script_loader.lua
new file mode 100644
index 0000000..a85dea6
--- /dev/null
+++ b/Source/Asura.Framework/scripts/filesystem/script_loader.lua
@@ -0,0 +1,5 @@
+local loader = AsuraEngine.Loader.New("script")
+
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/filesystem/shader_loader.lua b/Source/Asura.Framework/scripts/filesystem/shader_loader.lua
new file mode 100644
index 0000000..d488eb9
--- /dev/null
+++ b/Source/Asura.Framework/scripts/filesystem/shader_loader.lua
@@ -0,0 +1,5 @@
+local loader = AsuraEngine.Loader.New("shader")
+
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/filesystem/statemap_loader.lua b/Source/Asura.Framework/scripts/filesystem/statemap_loader.lua
new file mode 100644
index 0000000..ededcfc
--- /dev/null
+++ b/Source/Asura.Framework/scripts/filesystem/statemap_loader.lua
@@ -0,0 +1,7 @@
+require "ai/statemap_manager"
+local loader = AsuraEngine.Loader.New("statemap")
+
+--载入statemap
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/framework.lua b/Source/Asura.Framework/scripts/framework.lua
new file mode 100644
index 0000000..14e7b24
--- /dev/null
+++ b/Source/Asura.Framework/scripts/framework.lua
@@ -0,0 +1,2 @@
+--框架入口文件
+require ""
diff --git a/Source/Asura.Framework/scripts/gameobject.lua b/Source/Asura.Framework/scripts/gameobject.lua
new file mode 100644
index 0000000..cd984ee
--- /dev/null
+++ b/Source/Asura.Framework/scripts/gameobject.lua
@@ -0,0 +1,115 @@
+--
+-- 实体,作为scene中的实体存在。Scene中唯一管理的就是实体entity,游戏里的所有component都依附于entity存在,包括camera组件。
+--
+require "transform"
+
+AsuraEngine.GameObject = AsuraEngine.Asset.Sub("GameObject")
+
+local GameObject = AsuraEngine.GameObject
+
+function GameObject:Ctor()
+ self.transform = AsuraEngine.Transform.New()
+ self.subentities = {} -- Sub node entities
+end
+
+function GameObject:AddChild(gameobject)
+ table.insert(self.child, gameobject)
+end
+
+function GameObject:AddComponent(type, name)
+ local cname = type
+ if name == nil then
+ cname = name
+ end
+ local component = AsuraEngine.Component.GetComponent(type)
+ self.components[cname] = compoennt
+end
+
+-- 根据组件名拿到组件
+function GameObject:GetComponent(name)
+ return self.components[name]
+end
+
+-- 根据组件类型拿到组件
+function GameObject:GetComponentByType(tname)
+
+end
+
+function GameObject:OnEnable()
+
+end
+
+function GameObject:OnEvent(e)
+ if self.components == nil or type(self.components) ~= "table" then
+ AsuraEditor.LogError("")
+ return
+ end
+ for name, component in self.components do
+ if component.OnEvent ~= nil then
+ component:OnEvent(e)
+ end
+ end
+end
+
+function GameObject:OnUpdate(dt)
+ for name, component in self.components do
+ if component.OnUpdate ~= nil then
+ component:OnUpdate(dt)
+ end
+ end
+end
+
+function GameObject:OnRender()
+ for name, component in self.components do
+ if component.OnRender ~= nil then
+ component.OnRender()
+ end
+ end
+end
+
+function GameObject:OnDisable()
+ for name, component in self.components do
+ if component.OnDisable ~= nil then
+ component.OnDisable()
+ end
+ end
+end
+
+function GameObject:GetTrasform()
+ return self.transform
+end
+
+function GameObject:GetPosition()
+
+end
+
+function GameObject:GetScale()
+
+end
+
+function GameObject:GetRotation()
+
+end
+
+function GameObject:SetTrasform(transform)
+
+end
+
+function GameObject:SetPosition()
+
+end
+
+function GameObject:SetScale()
+
+end
+
+function GameObject:SetRotation()
+
+end
+
+--写asset
+function GameObject:ToAsset()
+
+end
+
+return GameObject \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/animation.lua b/Source/Asura.Framework/scripts/graphics/animation.lua
new file mode 100644
index 0000000..b6673c6
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/animation.lua
@@ -0,0 +1,15 @@
+AsuraEngine.Animation = AsuraEngine.Asset.Sub("Animation")
+
+local Animation = AsuraEngine.Animation
+
+local Frame = AsuraEngine.Class("Frame")
+
+function Frame.Ctor(self)
+
+end
+
+function Animation.Ctor(self)
+
+end
+
+return Animation \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/animator.lua b/Source/Asura.Framework/scripts/graphics/animator.lua
new file mode 100644
index 0000000..02f67ff
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/animator.lua
@@ -0,0 +1,31 @@
+AsuraEngine.Animator = AsuraEngine.Component.Sub("Animator")
+
+local Animator = AsuraEngine.Animator
+
+-- Animator inspector variables.
+Animator.spriteRenderer = AsuraEngine.Type.SpriteRenderer
+Animator.animation = AsuraEngine.Type.Animation
+
+function Animator:Ctor(gameobject, animation)
+ self.base(gameobject)
+ self.spriteRenderer = gameobject:GetSpriteRenderer()
+ self.animation = animation
+end
+
+function Animator:SetAnimation(animation)
+ self.animation = animation
+end
+
+function Animator:GetAnimation()
+ return self.animation
+end
+
+function Animator:OnUpdate(dt)
+
+end
+
+function Animator:OnRender()
+
+end
+
+return Animator \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/camera.lua b/Source/Asura.Framework/scripts/graphics/camera.lua
new file mode 100644
index 0000000..c8176f8
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/camera.lua
@@ -0,0 +1,21 @@
+AsuraEngine.Camera = AsuraEngine.Component.Sub("Camera")
+
+local Camera = AsuraEngine.Camera
+
+Camera.isCulling = AsuraEngine.Type.Bool
+Camera.isOnScreen = AsuraEngine.Type.Bool
+
+function Camera.Ctor(self)
+ self.isCulling = false
+ self.isOnScreen = false
+end
+
+function Camera.OnUpdate(dt)
+
+end
+
+function Camera.OnRender()
+
+end
+
+return Camera \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/canvas.lua b/Source/Asura.Framework/scripts/graphics/canvas.lua
new file mode 100644
index 0000000..248c3ab
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/canvas.lua
@@ -0,0 +1,34 @@
+AsuraEngine.Canvas = AsuraEngine.Component.Sub("Canvas")
+
+local Canvas = AsuraEngine.Canvas
+
+function Canvas.Ctor(self, width, height)
+ self.simCanvas = AsuraEngine.SimCanvas.New(width, height)
+ self.width = width
+ self.height = height
+end
+
+function Canvas.GetWidth(self)
+ return self.width
+end
+
+function Canvas.GetHeight(self)
+ return self.height
+end
+
+function Canvas.GetSize(self)
+ return self.width, self.height
+end
+
+function Canvas.OnEnable(self)
+ if self.simCanvas == nil then
+ return
+ end
+ self.simCanvas:Begin()
+end
+
+function Canvas.OnDisable(self)
+
+end
+
+return Canvas \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/default_shaders.lua b/Source/Asura.Framework/scripts/graphics/default_shaders.lua
new file mode 100644
index 0000000..bd54cb9
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/default_shaders.lua
@@ -0,0 +1,5 @@
+--[[
+õshaders.
+]]
+
+
diff --git a/Source/Asura.Framework/scripts/graphics/image.lua b/Source/Asura.Framework/scripts/graphics/image.lua
new file mode 100644
index 0000000..ae91466
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/image.lua
@@ -0,0 +1,38 @@
+-- 图片资源
+AsuraEngine.Image = AsuraEngine.Asset.Sub("Image")
+
+local Image = AsuraEngine.Image
+
+function Image.Ctor(self, path)
+ local simImage = AsuraEngine.SimImage.New(path)
+ local w, h = simImage:GetSize()
+ self.simImage = simImage
+ self.width = w
+ self.height = h
+end
+
+function Image.GetWidth(self)
+ return self.simImage.GetWidth()
+end
+
+function Image.GetHeight(self)
+ return self.simImage.GetHeight()
+end
+
+function Image.GetSize(self)
+ return self.simImage.GetSize()
+end
+
+--获得x,y位置的颜色值
+function Image.GetColor(self, x, y)
+ return self.simImage.GetColor(x, y)
+end
+
+--获得所有像素,返回到一个table里
+function Image.GetPixels(self)
+ return self.simImage:GetPixels()
+end
+
+--image不可再编辑器编辑,所以没有ToAsset方法
+--function Image.ToAsset()
+--end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/material.lua b/Source/Asura.Framework/scripts/graphics/material.lua
new file mode 100644
index 0000000..7028f98
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/material.lua
@@ -0,0 +1,47 @@
+--material是shader的代理
+AsuraEngine.Material = AsuraEngine.Asset.Sub("Material")
+
+local Material = AsuraEngine.Material
+
+function Material.Ctor(self)
+ self.mUniforms = {} --uniform变量和值
+ self.mIsShared = false
+end
+
+function Material.Clone(self)
+
+end
+
+function Material:ToAsset()
+
+end
+
+function Material:GetUniform(name)
+
+end
+
+function Material:SetFloat(uniform, value)
+
+end
+
+function Material:SetTexture(uniform, tex)
+
+end
+
+function Material:SetInteger(unifrom, value)
+
+end
+
+function Material:SetVec2(uniform, value)
+
+end
+
+function Material:SetMat44(uniform, value)
+
+end
+
+function Material:GetUniformID()
+
+end
+
+return Material \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/material_manager.lua b/Source/Asura.Framework/scripts/graphics/material_manager.lua
new file mode 100644
index 0000000..086a5db
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/material_manager.lua
@@ -0,0 +1,3 @@
+local MaterialManager = AsuraEngine.Manager.New()
+
+return MaterialManager \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/mesh2d.lua b/Source/Asura.Framework/scripts/graphics/mesh2d.lua
new file mode 100644
index 0000000..13b270a
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/mesh2d.lua
@@ -0,0 +1,9 @@
+AsuraEngine.Mesh2D = AsuraEngine.Asset.Sub("Mesh2D")
+
+local Mesh2D = AsuraEngine.Mesh2D
+
+function Mesh2D.Ctor(self)
+
+end
+
+return Mesh2D \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/mesh2d_renderer.lua b/Source/Asura.Framework/scripts/graphics/mesh2d_renderer.lua
new file mode 100644
index 0000000..67577bc
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/mesh2d_renderer.lua
@@ -0,0 +1,13 @@
+AsuraEngine.Mesh2DRenderer = AsuraEngine.Renderer.Sub("Mesh2DRenderer")
+
+local Mesh2DRenderer = AsuraEngine.Mesh2DRenderer
+
+function Mesh2DRenderer.Ctor(self, material)
+ self.base(material)
+end
+
+function Mesh2DRenderer.OnRender(self)
+
+end
+
+return Mesh2DRenderer \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/particle_system.lua b/Source/Asura.Framework/scripts/graphics/particle_system.lua
new file mode 100644
index 0000000..055d1b2
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/particle_system.lua
@@ -0,0 +1,20 @@
+require "graphics.sprite_renderer"
+
+AsuraEngine.ParticleSystem = AsuraEngine.Component.Sub("ParticleSystem")
+
+local ParticleSystem = AsuraEngine.ParticleSystem
+
+function ParticleSystem.Ctor(self, gameobject, def)
+ self.base(gameobject)
+ self.spriteRenderer = AsuraEngine.SpriteRenderer.New()
+end
+
+function ParticleSystem.OnRenderer()
+
+end
+
+function ParticleSystem.OnUpdate(dt)
+
+end
+
+return ParticleSystem \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/renderer.lua b/Source/Asura.Framework/scripts/graphics/renderer.lua
new file mode 100644
index 0000000..46fd548
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/renderer.lua
@@ -0,0 +1,19 @@
+local Renderer = AsuraEngine.Component.Sub("Renderer")
+AsuraEngine.Renderer = Renderer
+
+function Renderer.Ctor(self)
+ self.mMaterials = {}
+ self.mMaterial = nil
+ self.mIsMultiMaterials = false
+end
+
+--取材质,如果是shared,那么从此材质clone一个
+function Renderer.GetMaterial(self)
+
+end
+
+function Renderer.IsMultiMaterials(self)
+ return self.mIsMultiMaterials
+end
+
+return Renderer \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/shader.lua b/Source/Asura.Framework/scripts/graphics/shader.lua
new file mode 100644
index 0000000..e427b1b
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/shader.lua
@@ -0,0 +1,43 @@
+AsuraEngine.Shader = AsuraEngine.Asset.Sub("Shader")
+
+local Shader = AsuraEngine.Shader
+
+function Shader.Ctor(self, vert, frag)
+ local simShader = AsuraEngine.simShader(vert, frag)
+ self.simShader = shader
+
+end
+
+function Shader.SendVec2(self, name, vec2)
+
+end
+
+function Shader.SendVec3(self, name, vec3)
+
+end
+
+function Shader.SendVec4(self, name, vec4)
+
+end
+
+function Shader.SendTexture(self, name, tex)
+
+end
+
+function Shader.SendFloat(self, name, number)
+
+end
+
+function Shader.SendInteger(self, name, integer)
+
+end
+
+function Shader.SendColor(self, name, color)
+
+end
+
+function Shader.SendMat44(self, name, mat44)
+
+end
+
+return Shader \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/shape.lua b/Source/Asura.Framework/scripts/graphics/shape.lua
new file mode 100644
index 0000000..6d737f0
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/shape.lua
@@ -0,0 +1,12 @@
+--
+-- 2D图形
+--
+AsuraEngine.Shape = AsuraEngine.Asset.Sub("Shape")
+
+local Shape = AsuraEngine.Shape
+
+function Shape.Ctor(self)
+
+end
+
+return Shape \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/shape_renderer.lua b/Source/Asura.Framework/scripts/graphics/shape_renderer.lua
new file mode 100644
index 0000000..8c002a2
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/shape_renderer.lua
@@ -0,0 +1,13 @@
+AsuraEngine.ShapeRenderer = AsuraEngine.Component.Sub("ShapeRenderer")
+
+local ShapeRenderer = AsuraEngine.ShapeRenderer
+
+function ShapeRenderer.OnRenderer()
+
+end
+
+function ShapeRenderer.OnUpdate(dt)
+
+end
+
+return ShapeRenderer \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/sprite.lua b/Source/Asura.Framework/scripts/graphics/sprite.lua
new file mode 100644
index 0000000..745138e
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/sprite.lua
@@ -0,0 +1,10 @@
+local Sprite = AsuraEngine.Asset.Sub("Sprite")
+AsuraEngine.Sprite = Sprite
+
+function Sprite.Ctor(self, image)
+ self.image = image
+end
+
+function Sprite.ToAsset(self)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/sprite_batch_renderer.lua b/Source/Asura.Framework/scripts/graphics/sprite_batch_renderer.lua
new file mode 100644
index 0000000..9621bce
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/sprite_batch_renderer.lua
@@ -0,0 +1,9 @@
+AsuraEngine.SpriteBatchRenderer = AsuraEngine.Component.Sub("SpriteBatchRenderer")
+
+local SpriteBatchRenderer = AsuraEngine.SpriteBatchRenderer
+
+function SpriteBatchRenderer.Ctor(self)
+
+end
+
+return SpriteBatchRenderer \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/graphics/sprite_renderer.lua b/Source/Asura.Framework/scripts/graphics/sprite_renderer.lua
new file mode 100644
index 0000000..2d1fae5
--- /dev/null
+++ b/Source/Asura.Framework/scripts/graphics/sprite_renderer.lua
@@ -0,0 +1,14 @@
+require "graphics.renderer"
+
+local SpriteRenderer = AsuraEngine.Renderer.Sub("Spriterenderer")
+AsuraEngine.SpriteRenderer = SpriteRenderer
+
+function SpriteRenderer.Ctor(self)
+ self.mMaterials = {}
+end
+
+function SpriteRenderer:OnRender()
+
+end
+
+return SpriteRenderer \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/gui/button.lua b/Source/Asura.Framework/scripts/gui/button.lua
new file mode 100644
index 0000000..67d0943
--- /dev/null
+++ b/Source/Asura.Framework/scripts/gui/button.lua
@@ -0,0 +1,21 @@
+AsuraEngine.Button = AsuraEngine.Component.Sub("Button")
+
+local Button = AsuraEngine.Button
+
+function Button.Ctor(self)
+
+end
+
+function Button.OnEvent(e)
+
+end
+
+function Button.OnRender()
+
+end
+
+function Button.OnUpdate(dt)
+
+end
+
+return Button \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/gui/text.lua b/Source/Asura.Framework/scripts/gui/text.lua
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Source/Asura.Framework/scripts/gui/text.lua
diff --git a/Source/Asura.Framework/scripts/managers/scene_manager.lua b/Source/Asura.Framework/scripts/managers/scene_manager.lua
new file mode 100644
index 0000000..fc5a6ba
--- /dev/null
+++ b/Source/Asura.Framework/scripts/managers/scene_manager.lua
@@ -0,0 +1,16 @@
+AsuraEngine.SceneManager = AsuraEngine.Class("SceneManager")
+
+local SceneManager = AsuraEngine.SceneManager
+
+--游戏里的所有场景
+SceneManager.scenes = {}
+
+function SceneManager.Ctor()
+
+end
+
+function SceneManager.GetSceneByGUID()
+
+end
+
+return SceneManager \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/managers/sprite_manager.lua b/Source/Asura.Framework/scripts/managers/sprite_manager.lua
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Source/Asura.Framework/scripts/managers/sprite_manager.lua
diff --git a/Source/Asura.Framework/scripts/math/curve.lua b/Source/Asura.Framework/scripts/math/curve.lua
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Source/Asura.Framework/scripts/math/curve.lua
diff --git a/Source/Asura.Framework/scripts/path/path.lua b/Source/Asura.Framework/scripts/path/path.lua
new file mode 100644
index 0000000..3b6079d
--- /dev/null
+++ b/Source/Asura.Framework/scripts/path/path.lua
@@ -0,0 +1,13 @@
+local Path = AsuraEngine.Asset.New("path")
+
+function Path:Ctor()
+
+end
+
+-- ToAssetѶpathתΪ.assetļʽ
+function Path.ToAsset(path)
+ local builder = AsuraEngine.AssetBuilder.Get()
+
+end
+
+return Path \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/path/path_calculator.lua b/Source/Asura.Framework/scripts/path/path_calculator.lua
new file mode 100644
index 0000000..1a564b8
--- /dev/null
+++ b/Source/Asura.Framework/scripts/path/path_calculator.lua
@@ -0,0 +1,12 @@
+--[[
+ڱ༭componentsб
+]]
+local PathCalculator = AsuraEngine.Component.New("PathCalculator")
+
+PathCalculator.path = AsuraEngine.Asset.Type("path", "·")
+
+function PathCalculator:ctor(path)
+ self.path = path
+end
+
+return PathCalculator \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/path/path_manager.lua b/Source/Asura.Framework/scripts/path/path_manager.lua
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Source/Asura.Framework/scripts/path/path_manager.lua
diff --git a/Source/Asura.Framework/scripts/scene.lua b/Source/Asura.Framework/scripts/scene.lua
new file mode 100644
index 0000000..c0eaaa8
--- /dev/null
+++ b/Source/Asura.Framework/scripts/scene.lua
@@ -0,0 +1,21 @@
+--
+-- Scene是一系列gameobject的集合。
+--
+AsuraEngine.Scene = AsuraEngine.Asset.Sub("Scene")
+
+local Scene = AsuraEngine.Scene
+
+function Scene.Ctor(self)
+ self.rootGameObjects = {} --当前场景的所有root gameobject
+end
+
+--获取当前的场景
+function Scene.GetCurrent()
+
+end
+
+function Scene.ToAsset()
+
+end
+
+return Scene \ No newline at end of file
diff --git a/Source/Asura.Framework/scripts/transform.lua b/Source/Asura.Framework/scripts/transform.lua
new file mode 100644
index 0000000..a415921
--- /dev/null
+++ b/Source/Asura.Framework/scripts/transform.lua
@@ -0,0 +1,9 @@
+-- transform的起点在左下角,逆时针为正向
+AsuraEngine.Transform = AsuraEngine.Class("Transform")
+local Transform = AsuraEngine.Transform
+
+function Transform.Ctor(self)
+ self.position = {x=0, y=0}
+ self.rotation = 0
+ self.size = {w=0, h=0}
+end