From 0c65330f29d214cdfd810e83096669c5f2c20bee Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 20 Jan 2019 19:42:03 +0800 Subject: *misc --- Source/Asura.Framework/Component.lua | 22 +++++++++++++++++----- .../Asura.Framework/Filesystem/AnimationLoader.lua | 10 ++++++++++ .../Filesystem/GameObjectLoader.lua | 0 Source/Asura.Framework/Filesystem/Impoter.lua | 22 ---------------------- Source/Asura.Framework/Filesystem/Loader.lua | 22 ++++++++++++++++++++++ .../Asura.Framework/Filesystem/MaterialLoader.lua | 10 ++++++++++ Source/Asura.Framework/Filesystem/PathLoader.lua | 11 +++++++++++ Source/Asura.Framework/Filesystem/PrefabLoader.lua | 0 Source/Asura.Framework/Filesystem/SceneLoader.lua | 0 Source/Asura.Framework/GUI/Button.lua | 7 +++++++ Source/Asura.Framework/GUI/Text.lua | 0 Source/Asura.Framework/GameObject.lua | 8 ++++++-- Source/Asura.Framework/Graphics/Animation.lua | 5 +++++ Source/Asura.Framework/Graphics/DefaultShaders.lua | 5 +++++ Source/Asura.Framework/Graphics/Material.lua | 18 ++++++++++++++++++ .../Asura.Framework/Graphics/MaterialManager.lua | 5 +++++ .../Graphics/ParticleSystemManager.lua | 0 Source/Asura.Framework/Math/Curve.lua | 0 Source/Asura.Framework/Path/Path.lua | 13 +++++++++++++ Source/Asura.Framework/Path/PathCalculator.lua | 12 ++++++++++++ Source/Asura.Framework/Path/PathManager.lua | 0 Source/Asura.Framework/README.md | 2 +- 22 files changed, 142 insertions(+), 30 deletions(-) create mode 100644 Source/Asura.Framework/Filesystem/AnimationLoader.lua create mode 100644 Source/Asura.Framework/Filesystem/GameObjectLoader.lua delete mode 100644 Source/Asura.Framework/Filesystem/Impoter.lua create mode 100644 Source/Asura.Framework/Filesystem/Loader.lua create mode 100644 Source/Asura.Framework/Filesystem/MaterialLoader.lua create mode 100644 Source/Asura.Framework/Filesystem/PathLoader.lua create mode 100644 Source/Asura.Framework/Filesystem/PrefabLoader.lua create mode 100644 Source/Asura.Framework/Filesystem/SceneLoader.lua create mode 100644 Source/Asura.Framework/GUI/Button.lua create mode 100644 Source/Asura.Framework/GUI/Text.lua create mode 100644 Source/Asura.Framework/Graphics/Animation.lua create mode 100644 Source/Asura.Framework/Graphics/DefaultShaders.lua create mode 100644 Source/Asura.Framework/Graphics/Material.lua create mode 100644 Source/Asura.Framework/Graphics/MaterialManager.lua create mode 100644 Source/Asura.Framework/Graphics/ParticleSystemManager.lua create mode 100644 Source/Asura.Framework/Math/Curve.lua create mode 100644 Source/Asura.Framework/Path/Path.lua create mode 100644 Source/Asura.Framework/Path/PathCalculator.lua create mode 100644 Source/Asura.Framework/Path/PathManager.lua (limited to 'Source/Asura.Framework') diff --git a/Source/Asura.Framework/Component.lua b/Source/Asura.Framework/Component.lua index 54bd3c7..027c066 100644 --- a/Source/Asura.Framework/Component.lua +++ b/Source/Asura.Framework/Component.lua @@ -1,9 +1,21 @@ +local Component = Class() -local Component = Class(function() - self.gameobject = nil +Component.gameobject = AsuraEngine.Type.GameObject -end) +function Component:Ctor(go) + self.gameobject = go +end -Component.gameobject = AsuraEngine.Type.GameObject +function Component:OnEvent(e) + +end + +function Component:OnUpdate(ms) + +end + +function Component:OnDraw() + +end -return Component +return Component \ No newline at end of file diff --git a/Source/Asura.Framework/Filesystem/AnimationLoader.lua b/Source/Asura.Framework/Filesystem/AnimationLoader.lua new file mode 100644 index 0000000..5d19758 --- /dev/null +++ b/Source/Asura.Framework/Filesystem/AnimationLoader.lua @@ -0,0 +1,10 @@ +local AnimationLoader = AsuraEngine.Loader.New("animation") +local AnimationManager = require "AnimationManager" + +function AnimationLoader.Load(mat) + + local animation = AsuraEngine.Class() + +end + +return AnimationLoader \ No newline at end of file diff --git a/Source/Asura.Framework/Filesystem/GameObjectLoader.lua b/Source/Asura.Framework/Filesystem/GameObjectLoader.lua new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Framework/Filesystem/Impoter.lua b/Source/Asura.Framework/Filesystem/Impoter.lua deleted file mode 100644 index fbbd68a..0000000 --- a/Source/Asura.Framework/Filesystem/Impoter.lua +++ /dev/null @@ -1,22 +0,0 @@ ---[[ -基类,自定义的资源可以通过继承此类导入。自定义的资源的标记方法: - - ./resource.maptile - -在指定了导入impoter之后,自定义的资源允许通过下列方法标记: - - ./resource.maptile - -引擎会使用对应内部资源类型的importer导入资源 - -]] - -local importer = Class() - -function importer:InnerResource( data ) - - - -end - -return importer \ No newline at end of file diff --git a/Source/Asura.Framework/Filesystem/Loader.lua b/Source/Asura.Framework/Filesystem/Loader.lua new file mode 100644 index 0000000..fbbd68a --- /dev/null +++ b/Source/Asura.Framework/Filesystem/Loader.lua @@ -0,0 +1,22 @@ +--[[ +基类,自定义的资源可以通过继承此类导入。自定义的资源的标记方法: + + ./resource.maptile + +在指定了导入impoter之后,自定义的资源允许通过下列方法标记: + + ./resource.maptile + +引擎会使用对应内部资源类型的importer导入资源 + +]] + +local importer = Class() + +function importer:InnerResource( data ) + + + +end + +return importer \ No newline at end of file diff --git a/Source/Asura.Framework/Filesystem/MaterialLoader.lua b/Source/Asura.Framework/Filesystem/MaterialLoader.lua new file mode 100644 index 0000000..8ecfa51 --- /dev/null +++ b/Source/Asura.Framework/Filesystem/MaterialLoader.lua @@ -0,0 +1,10 @@ +local MaterialLoader = AsuraEngine.Loader.New("material") +local MaterialManager = require "MaterialManager" + +function MaterialLoader.Load(mat) + + + +end + +return MaterialLoader \ No newline at end of file diff --git a/Source/Asura.Framework/Filesystem/PathLoader.lua b/Source/Asura.Framework/Filesystem/PathLoader.lua new file mode 100644 index 0000000..b9112df --- /dev/null +++ b/Source/Asura.Framework/Filesystem/PathLoader.lua @@ -0,0 +1,11 @@ +local PathLoader = AsuraEngine.Loader.New("path") +local PathManager = require "Path/PathManager" + +function PathLoader.Load(asset) + if asset.type ~= "path" then + return nil + end + +end + +return Path \ No newline at end of file diff --git a/Source/Asura.Framework/Filesystem/PrefabLoader.lua b/Source/Asura.Framework/Filesystem/PrefabLoader.lua new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Framework/Filesystem/SceneLoader.lua b/Source/Asura.Framework/Filesystem/SceneLoader.lua new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Framework/GUI/Button.lua b/Source/Asura.Framework/GUI/Button.lua new file mode 100644 index 0000000..a63cc01 --- /dev/null +++ b/Source/Asura.Framework/GUI/Button.lua @@ -0,0 +1,7 @@ +-- 游戏里的imgui + +local Button = AsuraEngine.Component.Extend("Button") + + + +return Button \ No newline at end of file diff --git a/Source/Asura.Framework/GUI/Text.lua b/Source/Asura.Framework/GUI/Text.lua new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Framework/GameObject.lua b/Source/Asura.Framework/GameObject.lua index 358ba14..1b328ca 100644 --- a/Source/Asura.Framework/GameObject.lua +++ b/Source/Asura.Framework/GameObject.lua @@ -1,4 +1,4 @@ -local GameObject = Class() +local GameObject = AsuraEngine.Asset.SubClass("GameObject") function GameObject:OnEnable() @@ -8,7 +8,7 @@ function GameObject:OnEvent(e) end -function GameObject:OnUpdate() +function GameObject:OnUpdate(dt) end @@ -52,4 +52,8 @@ function GameObject:SetRotation() end +function GameObject:ToAsset() + +end + return GameObject \ No newline at end of file diff --git a/Source/Asura.Framework/Graphics/Animation.lua b/Source/Asura.Framework/Graphics/Animation.lua new file mode 100644 index 0000000..b73cdd8 --- /dev/null +++ b/Source/Asura.Framework/Graphics/Animation.lua @@ -0,0 +1,5 @@ +local Animation = AsuraEngine.Asset.New("animation") + + + +return Animation \ No newline at end of file diff --git a/Source/Asura.Framework/Graphics/DefaultShaders.lua b/Source/Asura.Framework/Graphics/DefaultShaders.lua new file mode 100644 index 0000000..bd54cb9 --- /dev/null +++ b/Source/Asura.Framework/Graphics/DefaultShaders.lua @@ -0,0 +1,5 @@ +--[[ +内置的shaders. +]] + + diff --git a/Source/Asura.Framework/Graphics/Material.lua b/Source/Asura.Framework/Graphics/Material.lua new file mode 100644 index 0000000..5875efc --- /dev/null +++ b/Source/Asura.Framework/Graphics/Material.lua @@ -0,0 +1,18 @@ +--[[ +材质,是对shader的代理 +]] +local Material = AsuraEngine.Class() + +function Material:Ctor() + +end + +function Material:ToAsset() + +end + +function Material:GetUniform() + +end + +return Material \ No newline at end of file diff --git a/Source/Asura.Framework/Graphics/MaterialManager.lua b/Source/Asura.Framework/Graphics/MaterialManager.lua new file mode 100644 index 0000000..46cc13d --- /dev/null +++ b/Source/Asura.Framework/Graphics/MaterialManager.lua @@ -0,0 +1,5 @@ +local MaterialManager = AsuraEngine.Manager.New() + + + +return MaterialManager \ No newline at end of file diff --git a/Source/Asura.Framework/Graphics/ParticleSystemManager.lua b/Source/Asura.Framework/Graphics/ParticleSystemManager.lua new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Framework/Math/Curve.lua b/Source/Asura.Framework/Math/Curve.lua new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Framework/Path/Path.lua b/Source/Asura.Framework/Path/Path.lua new file mode 100644 index 0000000..3b6079d --- /dev/null +++ b/Source/Asura.Framework/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/Path/PathCalculator.lua b/Source/Asura.Framework/Path/PathCalculator.lua new file mode 100644 index 0000000..1a564b8 --- /dev/null +++ b/Source/Asura.Framework/Path/PathCalculator.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/Path/PathManager.lua b/Source/Asura.Framework/Path/PathManager.lua new file mode 100644 index 0000000..e69de29 diff --git a/Source/Asura.Framework/README.md b/Source/Asura.Framework/README.md index 10a5290..c803f1f 100644 --- a/Source/Asura.Framework/README.md +++ b/Source/Asura.Framework/README.md @@ -1,3 +1,3 @@ -AsuraFramework是框架,使用ECS模式。 +AsuraFramework是框架,使用ECS模式。包含扩展的asset和组件。 -- cgit v1.1-26-g67d0