CSEngine
Loading...
Searching...
No Matches
SPrefab.h
1//
2// Created by ounols on 19. 2. 10.
3//
4
5#pragma once
6
7#include "../Object/SResource.h"
8#include "../Util/Quaternion.h"
9#include <string>
10
11namespace CSE {
12
13 class SGameObject;
14
15 class SPrefab : public SResource {
16 public:
17 RESOURCE_DEFINE_CONSTRUCTOR(SPrefab);
18
19 ~SPrefab() override;
20
21 SGameObject* Clone(const vec3& position, SGameObject* parent = nullptr);
22
23 SGameObject* Clone(const vec3& position, const vec3& scale, Quaternion rotation, SGameObject* parent = nullptr);
24
25 bool SetGameObject(SGameObject* obj);
26
27 void Exterminate() override;
28
29 SGameObject* GetRoot() const {
30 return m_root;
31 }
32
33 void SetValue(std::string name_str, Arguments value) override;
34
35 std::string PrintValue() const override;
36
37 protected:
38 void Init(const AssetMgr::AssetReference* asset) override;
39
40 void GenerateResourceID(SGameObject* obj = nullptr);
41
42 private:
43 std::string GetMetaString(const SGameObject& object, unsigned int startIndex);
44 std::string GenerateObjectMeta(const SGameObject& obj);
45
46 private:
47 SGameObject* m_root = nullptr;
48 };
49
50}
void SetValue(std::string name_str, Arguments value) override
Definition SPrefab.cpp:130