summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-01-27 01:26:36 +0800
committerchai <chaifix@163.com>2019-01-27 01:26:36 +0800
commit6c8788ed76e1ead173fdeb51caaa43d538fcfe21 (patch)
tree4ec71c3aca07d58d96574671f83f9750f901cb11 /Source
parent409262a6a26972770ba64728a60d45dd2d9fb752 (diff)
*misc
Diffstat (limited to 'Source')
-rw-r--r--Source/Asura.Engine/AI/BehaviorTree.h0
-rw-r--r--Source/Asura.Engine/AI/StateMachine.cpp0
-rw-r--r--Source/Asura.Engine/AI/StateMachine.h33
-rw-r--r--Source/Asura.Engine/AI/StateMap.cpp0
-rw-r--r--Source/Asura.Engine/AI/StateMap.h25
-rw-r--r--Source/Asura.Engine/Component.cpp0
-rw-r--r--Source/Asura.Engine/Component.h43
-rw-r--r--Source/Asura.Engine/FileSystem/Importer.Animation.cpp0
-rw-r--r--Source/Asura.Engine/FileSystem/Importer.Asset.cpp3
-rw-r--r--Source/Asura.Engine/FileSystem/Importer.Image.cpp0
-rw-r--r--Source/Asura.Engine/FileSystem/Importer.Sprite.cpp0
-rw-r--r--Source/Asura.Engine/FileSystem/Importer.StateMap.cpp0
-rw-r--r--Source/Asura.Engine/FileSystem/Importer.cpp0
-rw-r--r--Source/Asura.Engine/FileSystem/Importer.h21
-rw-r--r--Source/Asura.Engine/GameObject.cpp11
-rw-r--r--Source/Asura.Engine/GameObject.h56
-rw-r--r--Source/Asura.Engine/Graphics/Animation.cpp21
-rw-r--r--Source/Asura.Engine/Graphics/Animation.h128
-rw-r--r--Source/Asura.Engine/Graphics/Animator.cpp0
-rw-r--r--Source/Asura.Engine/Graphics/Animator.h96
-rw-r--r--Source/Asura.Engine/Graphics/Camera.cpp0
-rw-r--r--Source/Asura.Engine/Graphics/Camera.h42
-rw-r--r--Source/Asura.Engine/Graphics/CanvasRenderer.cpp0
-rw-r--r--Source/Asura.Engine/Graphics/CanvasRenderer.h30
-rw-r--r--Source/Asura.Engine/Graphics/Image.h1
-rw-r--r--Source/Asura.Engine/Graphics/Material.cpp18
-rw-r--r--Source/Asura.Engine/Graphics/Material.h189
-rw-r--r--Source/Asura.Engine/Graphics/Mesh2DRenderer.cpp0
-rw-r--r--Source/Asura.Engine/Graphics/Mesh2DRenderer.h19
-rw-r--r--Source/Asura.Engine/Graphics/ParticleSystem.cpp0
-rw-r--r--Source/Asura.Engine/Graphics/ParticleSystem.h22
-rw-r--r--Source/Asura.Engine/Graphics/Prefab.cpp0
-rw-r--r--Source/Asura.Engine/Graphics/Prefab.h30
-rw-r--r--Source/Asura.Engine/Graphics/Renderer.cpp0
-rw-r--r--Source/Asura.Engine/Graphics/Renderer.h39
-rw-r--r--Source/Asura.Engine/Graphics/ShapeRenderer.cpp0
-rw-r--r--Source/Asura.Engine/Graphics/ShapeRenderer.h0
-rw-r--r--Source/Asura.Engine/Graphics/Sprite.cpp0
-rw-r--r--Source/Asura.Engine/Graphics/Sprite.h71
-rw-r--r--Source/Asura.Engine/Graphics/SpriteRenderer.cpp0
-rw-r--r--Source/Asura.Engine/Graphics/SpriteRenderer.h32
-rw-r--r--Source/Asura.Engine/Graphics/Window.h7
-rw-r--r--Source/Asura.Engine/Layer.cpp0
-rw-r--r--Source/Asura.Engine/Layer.h0
-rw-r--r--Source/Asura.Engine/ObjectPool.cpp0
-rw-r--r--Source/Asura.Engine/ObjectPool.h14
-rw-r--r--Source/Asura.Engine/Scene.cpp0
-rw-r--r--Source/Asura.Engine/Scene.h28
-rw-r--r--Source/Asura.Engine/Transform.cpp0
-rw-r--r--Source/Asura.Engine/Transform.h24
-rw-r--r--Source/Asura.Framework/AI/StateMachine.lua3
-rw-r--r--Source/Asura.Framework/Audio/SoundPlayer.lua4
-rw-r--r--Source/Asura.Framework/Class.lua3
-rw-r--r--Source/Asura.Framework/Component.lua12
-rw-r--r--Source/Asura.Framework/Filesystem/Loader.lua19
-rw-r--r--Source/Asura.Framework/Filesystem/animation_loader.lua13
-rw-r--r--Source/Asura.Framework/Filesystem/material_loader.lua11
-rw-r--r--Source/Asura.Framework/Filesystem/path_loader.lua11
-rw-r--r--Source/Asura.Framework/Filesystem/scene_loader.lua5
-rw-r--r--Source/Asura.Framework/Framework.lua2
-rw-r--r--Source/Asura.Framework/Game.lua1
-rw-r--r--Source/Asura.Framework/Object.lua0
-rw-r--r--Source/Asura.Framework/Scene.lua11
-rw-r--r--Source/Asura.Framework/Transform.lua8
-rw-r--r--Source/Asura.Framework/ai/behavior_tree.lua (renamed from Source/Asura.Engine/AI/BehaviorTree.cpp)0
-rw-r--r--Source/Asura.Framework/ai/state_machine.lua6
-rw-r--r--Source/Asura.Framework/ai/state_map.lua12
-rw-r--r--Source/Asura.Framework/ai/statemachine.lua3
-rw-r--r--Source/Asura.Framework/audio/soundplayer.lua4
-rw-r--r--Source/Asura.Framework/class.lua3
-rw-r--r--Source/Asura.Framework/component.lua12
-rw-r--r--Source/Asura.Framework/entity.lua64
-rw-r--r--Source/Asura.Framework/filesystem/animation_loader.lua13
-rw-r--r--Source/Asura.Framework/filesystem/entity_loader.lua5
-rw-r--r--Source/Asura.Framework/filesystem/loader.lua19
-rw-r--r--Source/Asura.Framework/filesystem/material_loader.lua11
-rw-r--r--Source/Asura.Framework/filesystem/path_loader.lua11
-rw-r--r--Source/Asura.Framework/filesystem/scene_loader.lua5
-rw-r--r--Source/Asura.Framework/filesystem/statemap_loader.lua7
-rw-r--r--Source/Asura.Framework/framework.lua2
-rw-r--r--Source/Asura.Framework/game.lua1
-rw-r--r--Source/Asura.Framework/object.lua0
-rw-r--r--Source/Asura.Framework/scene.lua11
-rw-r--r--Source/Asura.Framework/transform.lua8
84 files changed, 223 insertions, 1080 deletions
diff --git a/Source/Asura.Engine/AI/BehaviorTree.h b/Source/Asura.Engine/AI/BehaviorTree.h
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/AI/BehaviorTree.h
+++ /dev/null
diff --git a/Source/Asura.Engine/AI/StateMachine.cpp b/Source/Asura.Engine/AI/StateMachine.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/AI/StateMachine.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/AI/StateMachine.h b/Source/Asura.Engine/AI/StateMachine.h
deleted file mode 100644
index 17f8945..0000000
--- a/Source/Asura.Engine/AI/StateMachine.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef __AE_STATEMACHINE_H__
-#define __AE_STATEMACHINE_H__
-
-#include "StateMap.h"
-#include "Component.h"
-
-namespace AsuraEngine
-{
- namespace AI
- {
-
- ///
- /// Ϊstate mapĴ
- ///
- class StateMachine : public Component
- {
- public:
-
-
-
- private:
-
- ///
- /// Statemachine ʹõstateͼ
- ///
- StateMap* mStateMap;
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/AI/StateMap.cpp b/Source/Asura.Engine/AI/StateMap.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/AI/StateMap.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/AI/StateMap.h b/Source/Asura.Engine/AI/StateMap.h
deleted file mode 100644
index 873e1d9..0000000
--- a/Source/Asura.Engine/AI/StateMap.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef __AE_STATEMAP_H__
-#define __AE_STATEMAP_H__
-
-#include "Filesystem/Asset.h"
-
-namespace AsuraEngine
-{
- namespace AI
- {
-
- class StateMap : public Filesystem::Asset
- {
- public:
-
-
- private:
-
-
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Component.cpp b/Source/Asura.Engine/Component.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Component.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Component.h b/Source/Asura.Engine/Component.h
deleted file mode 100644
index 807bbba..0000000
--- a/Source/Asura.Engine/Component.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef __AE_COMPONENT_H__
-#define __AE_COMPONENT_H__
-
-#include "GameObject.h"
-
-namespace AsuraEngine
-{
-
- class GameObject;
-
- ///
- /// ComponentͨprefabGameObjectϡ
- ///
- class Component : public Object
- {
- public:
-
- virtual void OnEnable();
- virtual void OnEvent();
- virtual void OnUpdate(uint32 milliseconds);
- virtual void OnRender();
- virtual void OnDisable();
-
- protected:
-
- enum class EnableCallback
- {
- OnEnable = 1,
- OnEvent = 1 << 1,
- OnUpdate = 1 << 2,
- OnRender = 1 << 3,
- OnDisable = 1 << 4,
- };
-
- EnableCallback mEnabledCallbacks;
-
- GameObject* mGameObject;
-
- };
-
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/FileSystem/Importer.Animation.cpp b/Source/Asura.Engine/FileSystem/Importer.Animation.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/FileSystem/Importer.Animation.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/FileSystem/Importer.Asset.cpp b/Source/Asura.Engine/FileSystem/Importer.Asset.cpp
deleted file mode 100644
index 0af7436..0000000
--- a/Source/Asura.Engine/FileSystem/Importer.Asset.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "Importer.h"
-
-// ԶԴ
diff --git a/Source/Asura.Engine/FileSystem/Importer.Image.cpp b/Source/Asura.Engine/FileSystem/Importer.Image.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/FileSystem/Importer.Image.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/FileSystem/Importer.Sprite.cpp b/Source/Asura.Engine/FileSystem/Importer.Sprite.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/FileSystem/Importer.Sprite.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/FileSystem/Importer.StateMap.cpp b/Source/Asura.Engine/FileSystem/Importer.StateMap.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/FileSystem/Importer.StateMap.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/FileSystem/Importer.cpp b/Source/Asura.Engine/FileSystem/Importer.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/FileSystem/Importer.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/FileSystem/Importer.h b/Source/Asura.Engine/FileSystem/Importer.h
deleted file mode 100644
index 16689e9..0000000
--- a/Source/Asura.Engine/FileSystem/Importer.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef __AE_IMPORTER_H__
-#define __AE_IMPORTER_H__
-
-namespace AsuraEngine
-{
- namespace Filesystem
- {
-
- ///
- /// ⲿԴΪAssetڸԴmanagerͬimporterǸ.asrļĸtagimage
- /// importImage룬assetimportAsset롣ԶԴûָimporterasset롣
- ///
- class Importer
- {
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/GameObject.cpp b/Source/Asura.Engine/GameObject.cpp
deleted file mode 100644
index 322f798..0000000
--- a/Source/Asura.Engine/GameObject.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "GameObject.h"
-
-namespace AsuraEngine
-{
-
- void GameObject::OnUpdate(uint32 milliseconds)
- {
-
- }
-
-}
diff --git a/Source/Asura.Engine/GameObject.h b/Source/Asura.Engine/GameObject.h
deleted file mode 100644
index 85dc87f..0000000
--- a/Source/Asura.Engine/GameObject.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef __AE_GAMEOBJECT_H__
-#define __AE_GAMEOBJECT_H__
-
-#include "./Containers/Vector.hpp"
-#include "./Math/Vector2.h"
-
-#include "Object.h"
-#include "Component.h"
-#include "Transform.h"
-#include "Manager.hpp"
-
-namespace AsuraEngine
-{
-
- ///
- /// Ϸʵ壬
- ///
- class GameObject final : public Object
- {
- public:
-
- // Ļص
-
- void OnEnable();
- void OnEvent();
- void OnUpdate(uint32 milliseconds);
- void OnRender();
- void OnDisable();
-
- // transformͨк޸GameObjectλáźת
-
- const Transform& GetTransform();
- const Math::Vector2& GetPosition();
- const Math::Vector2& GetScale();
- const Math::Vector2& GetRotation();
- void SetTransform(const Transform& transform);
- void SetPosition(const Math::Vector2& position);
- void SetScale(const Math::Vector2& scale);
- void SetRotation(const Math::Vector2& rotation);
-
- template<typename T>
- inline T GetComponent()
- {
- return NULL;
- }
-
- private:
-
- Transform mTransform;
- Containers::Vector<Component*> mComponents;
-
- };
-
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Graphics/Animation.cpp b/Source/Asura.Engine/Graphics/Animation.cpp
deleted file mode 100644
index 47643aa..0000000
--- a/Source/Asura.Engine/Graphics/Animation.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "Animation.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- void Animation::OnEnable()
- {
- mSpriteRenderer = mGameObject->GetComponent<SpriteRenderer*>();
- }
-
- void Animation::OnUpdate(uint32 milliseconds)
- {
- if (!mSpriteRenderer)
- return;
- mSpriteRenderer->SetSprite(NULL);
- }
-
- }
-}
diff --git a/Source/Asura.Engine/Graphics/Animation.h b/Source/Asura.Engine/Graphics/Animation.h
deleted file mode 100644
index 391da22..0000000
--- a/Source/Asura.Engine/Graphics/Animation.h
+++ /dev/null
@@ -1,128 +0,0 @@
-#ifndef __AE_ANIMATION_H__
-#define __AE_ANIMATION_H__
-
-#include "Sprite.h"
-#include "Component.h"
-#include "Manager.hpp"
-#include "SpriteRenderer.h"
-#include "Containers/Map.h"
-#include "Containers/Vector.hpp"
-#include "Containers/StringMap.hpp"
-#include "Filesystem/Asset.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- ///
- /// ؼ֡
- ///
- struct Frame
- {
- uint mask; //
- float time;
- Sprite* sprite;
- };
-
- ///
- /// SpriteԸıspriteĴСתšimageAnimationͨanimator޸ġ
- ///
- class Animation final : public Filesystem::Asset
- {
- public:
-
- enum UpdateMask
- {
- Scale = 1,
- Position = 1 << 1,
- Rotation = 1 << 2,
- Sprite = 1 << 3
- };
-
- struct Definition
- {
-
- };
-
- ///
- /// ʱһ֡
- ///
- Frame GetFrame(float t);
-
- ///
- /// ùؼ֡
- ///
- uint GetKeyFrameCount();
-
- ///
- /// Ƿѭ
- ///
- uint GetLoop();
-
- ///
- /// ȡʱ
- ///
- uint GetDuration();
-
- private:
-
- ///
- /// ؼ֡
- ///
- Containers::Vector<Frame> mFrames;
-
- ///
- /// ʱ
- ///
- float mDuration;
-
- ///
- /// Ƿѭ
- ///
- bool mLoop;
-
- ///
- /// ID
- ///
- uint mID;
-
- UpdateMask mUpdateMask;
-
- };
-
- class AnimationManager : public Manager
- {
- public:
-
- Containers::String GetAnimationName(uint ID);
-
- uint GetAnimationID(const Containers::String& name);
-
- Animation* GetAnimation(uint ID);
-
- Animation* GetAnimation(const Containers::String& name);
-
- ///
- /// ӶID
- ///
- uint AddAnimation(Animation* animation);
-
- private:
-
- ///
- /// ӳIDanimation
- ///
- Containers::StringMap<uint> mAnimationIDs;
-
- ///
- /// ӳkeyanimation
- ///
- Containers::Map<uint, Animation*> mAnimations;
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Graphics/Animator.cpp b/Source/Asura.Engine/Graphics/Animator.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Graphics/Animator.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Graphics/Animator.h b/Source/Asura.Engine/Graphics/Animator.h
deleted file mode 100644
index 4d3d269..0000000
--- a/Source/Asura.Engine/Graphics/Animator.h
+++ /dev/null
@@ -1,96 +0,0 @@
-#ifndef __AE_ANIMATOR_H__
-#define __AE_ANIMATOR_H__
-
-#include "Component.h"
-#include "Animation.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- ///
- /// animationҪΪanimationĴ
- ///
- class Animator final : public Component
- {
- public:
-
- void OnEnable() override;
- void OnUpdate(uint32 milliseconds) override;
-
- ///
- /// animation
- ///
- void SetAnimation(uint ID);
-
- ///
- /// animation
- ///
- void SetAnimation(Animation* animation);
-
- ///
- /// animation״̬
- ///
- void SetTime(float time);
-
- ///
- /// ޸IJٶ
- ///
- void SetSpeed(float speed);
-
- ///
- /// Ƿѭ
- ///
- void SetLoop(bool isloop);
-
- ///
- /// ݹؼ֡޸animation
- ///
- void SetKeyFrame(uint keyFrame);
-
- ///
- /// õ
- ///
- void SetToBegin();
-
- ///
- /// õʼ
- ///
- void SetToEnd();
-
- ///
- /// ͣ
- ///
- void Pause();
-
- private:
-
- ///
- /// ǰanimation
- ///
- Animation* mAnimation;
-
- ///
- /// AnimationҪһsprite renderer
- ///
- SpriteRenderer* mSpriteRenderer;
-
- ///
- /// ٶȣĬΪ1dt = mSpeed * DELTA_TIME
- ///
- float mSpeed;
-
- ///
- /// ǰִеʱ
- ///
- float mTime;
-
- bool mLoop;
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Graphics/Camera.cpp b/Source/Asura.Engine/Graphics/Camera.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Graphics/Camera.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Graphics/Camera.h b/Source/Asura.Engine/Graphics/Camera.h
deleted file mode 100644
index 699d342..0000000
--- a/Source/Asura.Engine/Graphics/Camera.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef __AE_CAMERA_H__
-#define __AE_CAMERA_H__
-
-#include "RenderTarget.h"
-#include "Component.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- ///
- /// Orthographic Camera.
- ///
- class Camera : public Component
- {
- public:
-
-
- private:
-
- ///
- /// ȾĿ
- ///
- RenderTarget* mRenderTarget;
-
- ///
- /// ǷȾĻ
- ///
- bool mIsOnScreen;
-
- ///
- /// ü
- ///
- bool mIsCulling;
-
- };
-
- }
-}
-
-#endif
diff --git a/Source/Asura.Engine/Graphics/CanvasRenderer.cpp b/Source/Asura.Engine/Graphics/CanvasRenderer.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Graphics/CanvasRenderer.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Graphics/CanvasRenderer.h b/Source/Asura.Engine/Graphics/CanvasRenderer.h
deleted file mode 100644
index ef188a5..0000000
--- a/Source/Asura.Engine/Graphics/CanvasRenderer.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __AE_CANVAS_RENDERER_H__
-#define __AE_CANVAS_RENDERER_H__
-
-#include "Canvas.h"
-#include "Renderer.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- class CanvasRenderer : public Renderer
- {
- public:
-
- void SetCanvas(Canvas* canvas);
- Canvas* GetCanvas();
-
- void SetBlendMode();
-
- private:
-
- Canvas * mCanvas;
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Graphics/Image.h b/Source/Asura.Engine/Graphics/Image.h
index 5b27079..fc013e3 100644
--- a/Source/Asura.Engine/Graphics/Image.h
+++ b/Source/Asura.Engine/Graphics/Image.h
@@ -1,6 +1,7 @@
#ifndef __AE_IMAGE_H__
#define __AE_IMAGE_H__
+#include "Containers/String.h"
#include "Math/Vector2.h"
#include "Manager.hpp"
#include "Texture.h"
diff --git a/Source/Asura.Engine/Graphics/Material.cpp b/Source/Asura.Engine/Graphics/Material.cpp
deleted file mode 100644
index eaf9742..0000000
--- a/Source/Asura.Engine/Graphics/Material.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "Material.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
-
-
- //--------------------------------------------------------------------------------------------------------
-
- int Material::l_SetColor(lua_State* L)
- {
-
- }
-
- }
-}
diff --git a/Source/Asura.Engine/Graphics/Material.h b/Source/Asura.Engine/Graphics/Material.h
deleted file mode 100644
index 68dfa1e..0000000
--- a/Source/Asura.Engine/Graphics/Material.h
+++ /dev/null
@@ -1,189 +0,0 @@
-#ifndef __AE_MATERIAL_H__
-#define __AE_MATERIAL_H__
-
-#include "Containers/Vector.hpp"
-#include "Containers/String.h"
-#include "Math/Vector2.h"
-#include "Math/Vector3.h"
-#include "Math/Vector4.h"
-#include "Math/Matrix44.h"
-#include "Scripting/Luax.hpp"
-
-#include "Shader.h"
-#include "Texture.h"
-#include "Manager.hpp"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- class MaterialFactory;
-
- ///
- /// ͨʵShaderеuniformsShader޸ĵı¶materialÿʿԲ컯ͬɫ
- /// ͬͨļ(.mat)ʵ֣ڴáAsuraУShader޷ֱӦõȾ̶һ
- /// ʹɲ޸shaderuniformsmaterial䵱shaderĴ
- ///
- class Material final : public Filesystem::Asset
- {
- public:
-
- enum class UniformsType
- {
- None = 0,
- Float,
- Int,
- Vector2,
- Vector3,
- Vector4,
- Matrix44,
- Texture,
- Color,
- };
-
- struct UniformsInfo
- {
- uint ID; // uniformID
- UniformsType type; // uniform
- union
- {
- float f;
- int i;
- Math::Vector2 v2;
- Math::Vector3 v3;
- Math::Vector4 v4;
- Math::Matrix44 m44;
- Texture* tex;
- Color col;
- }value; // uniformֵ
- };
-
- void SetShader(Shader* shader);
-
- // UniformڲУȾʱϴGPU
-
- ///
- /// uniformIDIDnamemapshader乲uniformֵʱͨIDѯuniform
- /// shaderҵuniform locationlocationֵ
- ///
- static int GetUniformID(const Containers::String& name);
-
- void SetTexture(uint ID, Texture* texture);
- void SetVector2(uint ID, Math::Vector2* vector2);
- void SetVector3(uint ID, Math::Vector3* vector3);
- void SetVector4(uint ID, Math::Vector4* vector4);
- void SetMatrix44(uint ID, Math::Matrix44* matrix44);
- void SetFloat(uint ID, float value);
- void SetInteger(uint ID, int value);
- void SetColor(uint ID, Color color);
-
- UniformsInfo GetUniformInfo(uint ID);
- float GetUniformInfof(uint ID);
- int GetUniformInfoi(uint ID);
- Math::Vector2 GetUniformInfov2(uint ID);
- Math::Vector3 GetUniformInfov3(uint ID);
- Math::Vector4 GetUniformInfov4(uint ID);
- Math::Matrix44 GetUniformInfom44(uint ID);
- Texture* GetUniformInfotex(uint ID);
- Color GetUniformInfocol(uint ID);
-
- // ϴ
-
- void SetVertexAttributes();
-
- private:
-
- friend class MaterialFactory;
-
- Material();
- Material(const Material& src);
- ~Material();
-
- ///
- ///
- ///
- uint mID;
-
- ///
- ///
- ///
- Shader* mShader;
-
- ///
- /// UniformsֵӳIDֵ
- ///
- Containers::Map<int, UniformsInfo> mUniforms;
-
- ///
- /// ǷǹIJ
- ///
- bool mIsShared;
-
- //----------------------------------------------------------------------------------------------------
-
- LUAX_DECL_FACTORY(Material);
-
- LUAX_DECL_METHOD(l_Clone);
-
- LUAX_DECL_METHOD(l_SetShader);
-
- LUAX_DECL_METHOD(l_SetTexture);
- LUAX_DECL_METHOD(l_SetVector2);
- LUAX_DECL_METHOD(l_SetVector3);
- LUAX_DECL_METHOD(l_SetVector4);
- LUAX_DECL_METHOD(l_SetMatrix44);
- LUAX_DECL_METHOD(l_SetFloat);
- LUAX_DECL_METHOD(l_SetInteger);
- LUAX_DECL_METHOD(l_SetColor);
-
- LUAX_DECL_METHOD(l_GetUniformInfo);
- LUAX_DECL_METHOD(l_GetUniformInfof);
- LUAX_DECL_METHOD(l_GetUniformInfoi);
- LUAX_DECL_METHOD(l_GetUniformInfov2);
- LUAX_DECL_METHOD(l_GetUniformInfov3);
- LUAX_DECL_METHOD(l_GetUniformInfov4);
- LUAX_DECL_METHOD(l_GetUniformInfom44);
- LUAX_DECL_METHOD(l_GetUniformInfotex);
- LUAX_DECL_METHOD(l_GetUniformInfocol);
-
- LUAX_DECL_METHOD(l_SetVertexAttributes);
-
- };
-
- class MaterialManager : public Manager
- {
- public:
-
- private:
-
- ///
- /// еimage
- ///
- Containers::Map<uint, Material*> mMaterials;
-
- ///
- /// image·IDӳ䡣Դ.asrimageͨ·õimageԲеimageڴmapС
- /// ɳ򴴽imageֻͨIDȡԳҪID
- ///
- Containers::StringMap<uint> mMaterialIDs;
-
- };
-
- class MaterialFactory : public Factory
- {
- public:
-
- ///
- /// һmaterial
- ///
- Material* Clone(Material* src);
-
- Material* Create();
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Graphics/Mesh2DRenderer.cpp b/Source/Asura.Engine/Graphics/Mesh2DRenderer.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Graphics/Mesh2DRenderer.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Graphics/Mesh2DRenderer.h b/Source/Asura.Engine/Graphics/Mesh2DRenderer.h
deleted file mode 100644
index fcbfd2c..0000000
--- a/Source/Asura.Engine/Graphics/Mesh2DRenderer.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef __AE_MESH2D_H__
-#define __AE_MESH2D_H__
-
-#include "FileSystem/Asset.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- class Mesh2D : public Filesystem::Asset
- {
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Graphics/ParticleSystem.cpp b/Source/Asura.Engine/Graphics/ParticleSystem.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Graphics/ParticleSystem.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Graphics/ParticleSystem.h b/Source/Asura.Engine/Graphics/ParticleSystem.h
deleted file mode 100644
index 078427a..0000000
--- a/Source/Asura.Engine/Graphics/ParticleSystem.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __AE_PARTICLESYSTEM_H__
-#define __AE_PARTICLESYSTEM_H__
-
-#include "Component.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- ///
- /// ϵͳ
- ///
- class ParticleSystem final : public Component
- {
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Graphics/Prefab.cpp b/Source/Asura.Engine/Graphics/Prefab.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Graphics/Prefab.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Graphics/Prefab.h b/Source/Asura.Engine/Graphics/Prefab.h
deleted file mode 100644
index 82a8da2..0000000
--- a/Source/Asura.Engine/Graphics/Prefab.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __AE_PREFAB_H__
-#define __AE_PREFAB_H__
-
-#include "Manager.hpp"
-#include "FileSystem/Asset.h"
-
-namespace AsuraEngine
-{
-
- ///
- /// PrefabGameObject
- ///
- class Prefab : public Filesystem::Asset
- {
-
- };
-
- class PrefabManager : public Manager
- {
-
- };
-
- class PrefabFactory
- {
-
- };
-
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Graphics/Renderer.cpp b/Source/Asura.Engine/Graphics/Renderer.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Graphics/Renderer.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Graphics/Renderer.h b/Source/Asura.Engine/Graphics/Renderer.h
deleted file mode 100644
index c3677a7..0000000
--- a/Source/Asura.Engine/Graphics/Renderer.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef __AE_RENDERER_H__
-#define __AE_RENDERER_H__
-
-#include "Component.h"
-#include "Material.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- ///
- /// ࣬ȾRendererദÿRenderer߱һʡ
- ///
- class Renderer : public Component
- {
- public:
-
- ///
- /// һô˷ͻ´shared materialô˷ζҪmaterialý޸ģʱʹõIJ
- /// shared materialҪһݣӰrenderer
- ///
- Material* GetMaterial();
-
- ///
- /// Ⱦص
- ///
- virtual void OnRender() = 0;
-
- protected:
-
- Material* mMaterial;
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Graphics/ShapeRenderer.cpp b/Source/Asura.Engine/Graphics/ShapeRenderer.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Graphics/ShapeRenderer.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Graphics/ShapeRenderer.h b/Source/Asura.Engine/Graphics/ShapeRenderer.h
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Graphics/ShapeRenderer.h
+++ /dev/null
diff --git a/Source/Asura.Engine/Graphics/Sprite.cpp b/Source/Asura.Engine/Graphics/Sprite.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Graphics/Sprite.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Graphics/Sprite.h b/Source/Asura.Engine/Graphics/Sprite.h
deleted file mode 100644
index b621f1b..0000000
--- a/Source/Asura.Engine/Graphics/Sprite.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef __AE_SPRITE_H__
-#define __AE_SPRITE_H__
-
-#include "Math/Vector2.h"
-#include "Transform.h"
-#include "Component.h"
-#include "Image.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- ///
- /// SpriteǿimageĴimagesprite乲ݣsprite𻯴imageԣתŵȡ
- ///
- class Sprite final : public Filesystem::Asset
- {
- public:
-
- enum Type
- {
-
- };
-
- ///
- /// 뷽ʽ
- ///
- enum Align
- {
-
- };
-
- struct SpriteDef
- {
- Image* image;
- Align align;
- Math::Vector2 anchor;
- Math::Vector2 size;
- };
-
- Sprite(SpriteDef definition);
- ~Sprite();
-
- private:
-
- ///
- /// ê
- ///
- Math::Vector2 mAnchor;
-
- ///
- /// С
- ///
- Math::Vector2 mSize;
-
- ///
- /// 󶨵image
- ///
- Image* mImage;
-
- //----------------------------------------------------------------------------------------------------
-
-
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Graphics/SpriteRenderer.cpp b/Source/Asura.Engine/Graphics/SpriteRenderer.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Graphics/SpriteRenderer.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Graphics/SpriteRenderer.h b/Source/Asura.Engine/Graphics/SpriteRenderer.h
deleted file mode 100644
index bd81509..0000000
--- a/Source/Asura.Engine/Graphics/SpriteRenderer.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __AE_SPRITE_RENDERER_H__
-#define __AE_SPRITE_RENDERER_H__
-
-#include "Renderer.h"
-#include "Sprite.h"
-
-namespace AsuraEngine
-{
- namespace Graphics
- {
-
- class SpriteRenderer final : public Renderer
- {
- public:
-
- void SetSprite(Sprite* sprite);
-
- void OnRender() override;
-
- private:
-
- ///
- /// Ⱦsprite
- ///
- Sprite* mSprite;
-
- };
-
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Graphics/Window.h b/Source/Asura.Engine/Graphics/Window.h
index 1707e3d..ab612fc 100644
--- a/Source/Asura.Engine/Graphics/Window.h
+++ b/Source/Asura.Engine/Graphics/Window.h
@@ -7,10 +7,15 @@ namespace AsuraEngine
{
///
- /// Ϸ
+ /// ڣֶ֧രڡڱ༭Ҫ֧֣runnerֻҪһڡ
///
class Window
{
+ public:
+
+
+ private:
+
};
diff --git a/Source/Asura.Engine/Layer.cpp b/Source/Asura.Engine/Layer.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Layer.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Layer.h b/Source/Asura.Engine/Layer.h
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Layer.h
+++ /dev/null
diff --git a/Source/Asura.Engine/ObjectPool.cpp b/Source/Asura.Engine/ObjectPool.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/ObjectPool.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/ObjectPool.h b/Source/Asura.Engine/ObjectPool.h
deleted file mode 100644
index bf97858..0000000
--- a/Source/Asura.Engine/ObjectPool.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __AE_OBJECT_POOL_H__
-#define __AE_OBJECT_POOL_H__
-
-namespace AsuraEngine
-{
-
- class ObjectPool
- {
-
- };
-
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Scene.cpp b/Source/Asura.Engine/Scene.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Scene.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Scene.h b/Source/Asura.Engine/Scene.h
deleted file mode 100644
index 742d872..0000000
--- a/Source/Asura.Engine/Scene.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef __AE_SCENE_H__
-#define __AE_SCENE_H__
-
-#include "FileSystem/Asset.h"
-#include "Containers/Vector.hpp"
-#include "GameObject.h"
-
-namespace AsuraEngine
-{
-
- ///
- /// Ϸ
- ///
- class Scene final : public Filesystem::Asset
- {
- public:
-
- //
-
- private:
-
- Containers::Vector<GameObject*> mGameObjects;
-
- };
-
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Engine/Transform.cpp b/Source/Asura.Engine/Transform.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Engine/Transform.cpp
+++ /dev/null
diff --git a/Source/Asura.Engine/Transform.h b/Source/Asura.Engine/Transform.h
deleted file mode 100644
index cca7575..0000000
--- a/Source/Asura.Engine/Transform.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __AE_TRANSFORM_H__
-#define __AE_TRANSFORM_H__
-
-#include "Object.h"
-#include "Math/Vector2.h"
-
-namespace AsuraEngine
-{
-
- ///
- /// TransformΪԣΪ
- ///
- class Transform final : public Object
- {
- private:
- Math::Vector2 position;
- Math::Vector2 rotation;
- Math::Vector2 scale;
-
- };
-
-}
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Framework/AI/StateMachine.lua b/Source/Asura.Framework/AI/StateMachine.lua
deleted file mode 100644
index 58012ca..0000000
--- a/Source/Asura.Framework/AI/StateMachine.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-local StateMachine = Class()
-
-return StateMachine \ No newline at end of file
diff --git a/Source/Asura.Framework/Audio/SoundPlayer.lua b/Source/Asura.Framework/Audio/SoundPlayer.lua
index 8bbeddb..c3921af 100644
--- a/Source/Asura.Framework/Audio/SoundPlayer.lua
+++ b/Source/Asura.Framework/Audio/SoundPlayer.lua
@@ -1,3 +1,5 @@
-local SoundPlayer = AsuraEngine.Component.New("SoundPlayer")
+local SoundPlayer = AsuraEngine.Component.Sub("SoundPlayer")
+
+
return SoundPlayer \ No newline at end of file
diff --git a/Source/Asura.Framework/Class.lua b/Source/Asura.Framework/Class.lua
index bec3e9a..164cb4a 100644
--- a/Source/Asura.Framework/Class.lua
+++ b/Source/Asura.Framework/Class.lua
@@ -1,5 +1,4 @@
local Class = {}
+AsuraEngine.Class = Class
-
-AsuraEngine.Class = Class \ No newline at end of file
diff --git a/Source/Asura.Framework/Component.lua b/Source/Asura.Framework/Component.lua
index dd843eb..b498a36 100644
--- a/Source/Asura.Framework/Component.lua
+++ b/Source/Asura.Framework/Component.lua
@@ -1,6 +1,14 @@
-local Component = Class()
+local Component = AsuraEngine.Class("Component")
-Component.gameobject = AsuraEngine.Type.GameObject
+AsuraEngine.Component = Component
+
+--Component.gameobject = AsuraEngine.Type.GameObject
+
+--派生新的组件
+function Component.Sub(cname)
+ assert(Component.components[cname] == nil)
+
+end
function Component:Ctor(go)
self.gameobject = go
diff --git a/Source/Asura.Framework/Filesystem/Loader.lua b/Source/Asura.Framework/Filesystem/Loader.lua
index 9ac058b..2d1e8cf 100644
--- a/Source/Asura.Framework/Filesystem/Loader.lua
+++ b/Source/Asura.Framework/Filesystem/Loader.lua
@@ -1,9 +1,14 @@
-local Loader = Class()
-
-function Loader:InnerResource( data )
-
-
-
+-- Assets loaders
+AsuraEngine.Loader = {}
+local Loader = AsuraEngine.Loader
+Loader.Loaders = {}
+
+function Loader.New(type)
+ if Loader.Loaders[type] ~= nil then
+ return Loader.Loaders[type]
+ end
+ local loader = {}
+ Loader[type] = loader
+ return loader
end
-return Loader \ No newline at end of file
diff --git a/Source/Asura.Framework/Filesystem/animation_loader.lua b/Source/Asura.Framework/Filesystem/animation_loader.lua
index f1dee29..4f989bd 100644
--- a/Source/Asura.Framework/Filesystem/animation_loader.lua
+++ b/Source/Asura.Framework/Filesystem/animation_loader.lua
@@ -1,11 +1,12 @@
-local AnimationLoader = AsuraEngine.Loader.New("animation")
-local AnimationManager = require "AnimationManager"
-local Animation = require "Animation"
+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
-
-return AnimationLoader \ No newline at end of file
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/Filesystem/material_loader.lua b/Source/Asura.Framework/Filesystem/material_loader.lua
index 2ea47f4..2c2058e 100644
--- a/Source/Asura.Framework/Filesystem/material_loader.lua
+++ b/Source/Asura.Framework/Filesystem/material_loader.lua
@@ -1,8 +1,7 @@
-local MaterialLoader = AsuraEngine.Loader.New("material")
-local MaterialManager = require "MaterialManager"
+require "MaterialManager"
-function MaterialLoader.Load(mat)
-
-end
+local loader = AsuraEngine.Loader.New("material")
-return MaterialLoader \ No newline at end of file
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/Filesystem/path_loader.lua b/Source/Asura.Framework/Filesystem/path_loader.lua
index c62be96..8618c03 100644
--- a/Source/Asura.Framework/Filesystem/path_loader.lua
+++ b/Source/Asura.Framework/Filesystem/path_loader.lua
@@ -1,10 +1,9 @@
-local PathLoader = AsuraEngine.Loader.New("path")
-local PathManager = require "Path/PathManager"
+require "Path/PathManager"
-function PathLoader.Load(asset)
+local loader = AsuraEngine.Loader.New("path")
+
+function loader.Load(asset)
if asset.type ~= "path" then
return nil
end
-end
-
-return Path \ No newline at end of file
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/Filesystem/scene_loader.lua b/Source/Asura.Framework/Filesystem/scene_loader.lua
index e69de29..3284c57 100644
--- a/Source/Asura.Framework/Filesystem/scene_loader.lua
+++ b/Source/Asura.Framework/Filesystem/scene_loader.lua
@@ -0,0 +1,5 @@
+local loader = AsuraEngine.Loader.New("scene")
+
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/Framework.lua b/Source/Asura.Framework/Framework.lua
index b465f78..449cc4a 100644
--- a/Source/Asura.Framework/Framework.lua
+++ b/Source/Asura.Framework/Framework.lua
@@ -1 +1 @@
-require "" \ No newline at end of file
+require ""
diff --git a/Source/Asura.Framework/Game.lua b/Source/Asura.Framework/Game.lua
index 3e44b53..e69de29 100644
--- a/Source/Asura.Framework/Game.lua
+++ b/Source/Asura.Framework/Game.lua
@@ -1 +0,0 @@
---űѭ
diff --git a/Source/Asura.Framework/Object.lua b/Source/Asura.Framework/Object.lua
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Framework/Object.lua
+++ /dev/null
diff --git a/Source/Asura.Framework/Scene.lua b/Source/Asura.Framework/Scene.lua
index afe6344..0ef41c7 100644
--- a/Source/Asura.Framework/Scene.lua
+++ b/Source/Asura.Framework/Scene.lua
@@ -1,8 +1,13 @@
---[[
-ԭ½
-]]
local Scene = Class()
+AsuraEngine.Scene = Scene
+function Scene.Ctor(self)
+ self.entities = {} --当前场景的所有entity
+end
+--获取当前的场景
+function Scene.GetCurrent()
+
+end
return Scene \ No newline at end of file
diff --git a/Source/Asura.Framework/Transform.lua b/Source/Asura.Framework/Transform.lua
index e69de29..e45a027 100644
--- a/Source/Asura.Framework/Transform.lua
+++ b/Source/Asura.Framework/Transform.lua
@@ -0,0 +1,8 @@
+local Transform = AsuraEngine.Class("Transform")
+AsuraEngine.Transform = Transform
+
+function Transform.Ctor(self)
+ self.position = {}
+ self.rotation = {}
+ self.size = {}
+end
diff --git a/Source/Asura.Engine/AI/BehaviorTree.cpp b/Source/Asura.Framework/ai/behavior_tree.lua
index e69de29..e69de29 100644
--- a/Source/Asura.Engine/AI/BehaviorTree.cpp
+++ b/Source/Asura.Framework/ai/behavior_tree.lua
diff --git a/Source/Asura.Framework/ai/state_machine.lua b/Source/Asura.Framework/ai/state_machine.lua
new file mode 100644
index 0000000..b1ff849
--- /dev/null
+++ b/Source/Asura.Framework/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/ai/state_map.lua b/Source/Asura.Framework/ai/state_map.lua
new file mode 100644
index 0000000..7e986de
--- /dev/null
+++ b/Source/Asura.Framework/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/ai/statemachine.lua b/Source/Asura.Framework/ai/statemachine.lua
deleted file mode 100644
index 58012ca..0000000
--- a/Source/Asura.Framework/ai/statemachine.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-local StateMachine = Class()
-
-return StateMachine \ No newline at end of file
diff --git a/Source/Asura.Framework/audio/soundplayer.lua b/Source/Asura.Framework/audio/soundplayer.lua
index 8bbeddb..c3921af 100644
--- a/Source/Asura.Framework/audio/soundplayer.lua
+++ b/Source/Asura.Framework/audio/soundplayer.lua
@@ -1,3 +1,5 @@
-local SoundPlayer = AsuraEngine.Component.New("SoundPlayer")
+local SoundPlayer = AsuraEngine.Component.Sub("SoundPlayer")
+
+
return SoundPlayer \ No newline at end of file
diff --git a/Source/Asura.Framework/class.lua b/Source/Asura.Framework/class.lua
index bec3e9a..164cb4a 100644
--- a/Source/Asura.Framework/class.lua
+++ b/Source/Asura.Framework/class.lua
@@ -1,5 +1,4 @@
local Class = {}
+AsuraEngine.Class = Class
-
-AsuraEngine.Class = Class \ No newline at end of file
diff --git a/Source/Asura.Framework/component.lua b/Source/Asura.Framework/component.lua
index dd843eb..b498a36 100644
--- a/Source/Asura.Framework/component.lua
+++ b/Source/Asura.Framework/component.lua
@@ -1,6 +1,14 @@
-local Component = Class()
+local Component = AsuraEngine.Class("Component")
-Component.gameobject = AsuraEngine.Type.GameObject
+AsuraEngine.Component = Component
+
+--Component.gameobject = AsuraEngine.Type.GameObject
+
+--派生新的组件
+function Component.Sub(cname)
+ assert(Component.components[cname] == nil)
+
+end
function Component:Ctor(go)
self.gameobject = go
diff --git a/Source/Asura.Framework/entity.lua b/Source/Asura.Framework/entity.lua
index ffd9b65..0edded4 100644
--- a/Source/Asura.Framework/entity.lua
+++ b/Source/Asura.Framework/entity.lua
@@ -1,27 +1,76 @@
-local Entity = AsuraEngine.Asset.SubClass("Entity")
+--[[
+实体,作为scene中的实体存在。
+]]
+require "transform"
-function Entity:OnEnable()
+local Entity = AsuraEngine.Asset.Sub("Entity")
+AsuraEngine.Entity = Entity
+function Entity:Ctor()
+ self.transform = AsuraEngine.Transform.New()
end
-function Entity:OnEvent(e)
+function Entity: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 Entity:GetComponent(name)
+ return self.components[name]
end
-function Entity:OnUpdate(dt)
+--根据组件类型拿到组件
+function Entity:GetComponentByType(tname)
end
-function Entity:OnRender()
+function Entity:OnEnable()
+
+end
+
+function Entity: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 Entity:OnUpdate(dt)
+ for name, component in self.components do
+ if component.OnUpdate ~= nil then
+ component:OnUpdate(dt)
+ end
+ end
end
-function Entity:OnDisable()
+function Entity:OnRender()
+ for name, component in self.components do
+ if component.OnRender ~= nil then
+ component.OnRender()
+ end
+ end
+end
+function Entity:OnDisable()
+ for name, component in self.components do
+ if component.OnDisable ~= nil then
+ component.OnDisable()
+ end
+ end
end
function Entity:GetTrasform()
-
+ return self.transform
end
function Entity:GetPosition()
@@ -52,6 +101,7 @@ function Entity:SetRotation()
end
+--写asset
function Entity:ToAsset()
end
diff --git a/Source/Asura.Framework/filesystem/animation_loader.lua b/Source/Asura.Framework/filesystem/animation_loader.lua
index f1dee29..4f989bd 100644
--- a/Source/Asura.Framework/filesystem/animation_loader.lua
+++ b/Source/Asura.Framework/filesystem/animation_loader.lua
@@ -1,11 +1,12 @@
-local AnimationLoader = AsuraEngine.Loader.New("animation")
-local AnimationManager = require "AnimationManager"
-local Animation = require "Animation"
+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
-
-return AnimationLoader \ No newline at end of file
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/filesystem/entity_loader.lua b/Source/Asura.Framework/filesystem/entity_loader.lua
index ad2351c..67a849d 100644
--- a/Source/Asura.Framework/filesystem/entity_loader.lua
+++ b/Source/Asura.Framework/filesystem/entity_loader.lua
@@ -1,2 +1,5 @@
-local EntityLoader = AsuraEngine.Loader.New("entity")
+local loader = AsuraEngine.Loader.New("entity")
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/filesystem/loader.lua b/Source/Asura.Framework/filesystem/loader.lua
index 9ac058b..2d1e8cf 100644
--- a/Source/Asura.Framework/filesystem/loader.lua
+++ b/Source/Asura.Framework/filesystem/loader.lua
@@ -1,9 +1,14 @@
-local Loader = Class()
-
-function Loader:InnerResource( data )
-
-
-
+-- Assets loaders
+AsuraEngine.Loader = {}
+local Loader = AsuraEngine.Loader
+Loader.Loaders = {}
+
+function Loader.New(type)
+ if Loader.Loaders[type] ~= nil then
+ return Loader.Loaders[type]
+ end
+ local loader = {}
+ Loader[type] = loader
+ return loader
end
-return Loader \ No newline at end of file
diff --git a/Source/Asura.Framework/filesystem/material_loader.lua b/Source/Asura.Framework/filesystem/material_loader.lua
index 2ea47f4..2c2058e 100644
--- a/Source/Asura.Framework/filesystem/material_loader.lua
+++ b/Source/Asura.Framework/filesystem/material_loader.lua
@@ -1,8 +1,7 @@
-local MaterialLoader = AsuraEngine.Loader.New("material")
-local MaterialManager = require "MaterialManager"
+require "MaterialManager"
-function MaterialLoader.Load(mat)
-
-end
+local loader = AsuraEngine.Loader.New("material")
-return MaterialLoader \ No newline at end of file
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/filesystem/path_loader.lua b/Source/Asura.Framework/filesystem/path_loader.lua
index c62be96..8618c03 100644
--- a/Source/Asura.Framework/filesystem/path_loader.lua
+++ b/Source/Asura.Framework/filesystem/path_loader.lua
@@ -1,10 +1,9 @@
-local PathLoader = AsuraEngine.Loader.New("path")
-local PathManager = require "Path/PathManager"
+require "Path/PathManager"
-function PathLoader.Load(asset)
+local loader = AsuraEngine.Loader.New("path")
+
+function loader.Load(asset)
if asset.type ~= "path" then
return nil
end
-end
-
-return Path \ No newline at end of file
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/filesystem/scene_loader.lua b/Source/Asura.Framework/filesystem/scene_loader.lua
index e69de29..3284c57 100644
--- a/Source/Asura.Framework/filesystem/scene_loader.lua
+++ b/Source/Asura.Framework/filesystem/scene_loader.lua
@@ -0,0 +1,5 @@
+local loader = AsuraEngine.Loader.New("scene")
+
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/filesystem/statemap_loader.lua b/Source/Asura.Framework/filesystem/statemap_loader.lua
new file mode 100644
index 0000000..ededcfc
--- /dev/null
+++ b/Source/Asura.Framework/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/framework.lua b/Source/Asura.Framework/framework.lua
index b465f78..449cc4a 100644
--- a/Source/Asura.Framework/framework.lua
+++ b/Source/Asura.Framework/framework.lua
@@ -1 +1 @@
-require "" \ No newline at end of file
+require ""
diff --git a/Source/Asura.Framework/game.lua b/Source/Asura.Framework/game.lua
index 3e44b53..e69de29 100644
--- a/Source/Asura.Framework/game.lua
+++ b/Source/Asura.Framework/game.lua
@@ -1 +0,0 @@
---űѭ
diff --git a/Source/Asura.Framework/object.lua b/Source/Asura.Framework/object.lua
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Framework/object.lua
+++ /dev/null
diff --git a/Source/Asura.Framework/scene.lua b/Source/Asura.Framework/scene.lua
index afe6344..0ef41c7 100644
--- a/Source/Asura.Framework/scene.lua
+++ b/Source/Asura.Framework/scene.lua
@@ -1,8 +1,13 @@
---[[
-ԭ½
-]]
local Scene = Class()
+AsuraEngine.Scene = Scene
+function Scene.Ctor(self)
+ self.entities = {} --当前场景的所有entity
+end
+--获取当前的场景
+function Scene.GetCurrent()
+
+end
return Scene \ No newline at end of file
diff --git a/Source/Asura.Framework/transform.lua b/Source/Asura.Framework/transform.lua
index e69de29..e45a027 100644
--- a/Source/Asura.Framework/transform.lua
+++ b/Source/Asura.Framework/transform.lua
@@ -0,0 +1,8 @@
+local Transform = AsuraEngine.Class("Transform")
+AsuraEngine.Transform = Transform
+
+function Transform.Ctor(self)
+ self.position = {}
+ self.rotation = {}
+ self.size = {}
+end