CSEngine
Loading...
Searching...
No Matches
SPrefab.h
1//
2// Created by ounols on 19. 2. 10.
3//
4
5#pragma once
6#include "../Object/SResource.h"
7#include "SGameObject.h"
8
9namespace CSE {
10
11 class SPrefab : public SResource {
12 public:
13 SPrefab();
14 ~SPrefab() override;
15
16 SGameObject* Clone(const vec3& position, SGameObject* parent = nullptr);
17
18 SGameObject* Clone(const vec3& position, const vec3& scale, Quaternion rotation, SGameObject* parent = nullptr);
19
20 bool SetGameObject(SGameObject* obj);
21
22 void Exterminate() override;
23
24 SGameObject* GetRoot() const {
25 return m_root;
26 }
27
28 protected:
29 void Init(const AssetMgr::AssetReference* asset) override;
30
31 void GenerateResourceID(SGameObject* obj = nullptr);
32
33 private:
34 SGameObject* m_root = nullptr;
35 };
36
37}