summaryrefslogtreecommitdiff
path: root/Source/Asura.Framework/scripts/gameobject.lua
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-19 23:06:27 +0800
committerchai <chaifix@163.com>2019-03-19 23:06:27 +0800
commit1497dccd63a84b7ee2b229b1ad9c5c02718f2a78 (patch)
treef8d1bff50da13e126d08c7345653e002e293202d /Source/Asura.Framework/scripts/gameobject.lua
parent5e2a973516e0729b225da9de0b03015dc5854ac4 (diff)
*rename
Diffstat (limited to 'Source/Asura.Framework/scripts/gameobject.lua')
-rw-r--r--Source/Asura.Framework/scripts/gameobject.lua115
1 files changed, 0 insertions, 115 deletions
diff --git a/Source/Asura.Framework/scripts/gameobject.lua b/Source/Asura.Framework/scripts/gameobject.lua
deleted file mode 100644
index a2d20ef..0000000
--- a/Source/Asura.Framework/scripts/gameobject.lua
+++ /dev/null
@@ -1,115 +0,0 @@
---
--- 实体,作为scene中的实体存在。Scene中唯一管理的就是实体entity,游戏里的所有component都依附于entity存在,包括camera组件。
---
-require "transform"
-
-AsuraEngine.GameObject = AsuraEngine.Asset.Extend("GameObject")
-
-local GameObject = AsuraEngine.GameObject
-
-function GameObject:Ctor()
- self.transform = AsuraEngine.Transform.New()
- self.subentities = {} -- Extend 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