Add context sharing on prefabs.
This commit is contained in:
@@ -21,7 +21,7 @@ void Camera::onDispose() {
|
||||
renderTarget = nullptr;
|
||||
}
|
||||
|
||||
void Camera::load(const SceneComponentLoadContext &ctx) {
|
||||
void Camera::load(SceneComponentLoadContext &ctx) {
|
||||
SceneComponent::load(ctx);
|
||||
|
||||
if(ctx.data.contains("fov")) {
|
||||
|
@@ -33,7 +33,7 @@ namespace Dawn {
|
||||
|
||||
void onInit() override;
|
||||
void onDispose() override;
|
||||
void load(const SceneComponentLoadContext &ctx) override;
|
||||
void load(SceneComponentLoadContext &ctx) override;
|
||||
|
||||
/**
|
||||
* Returns the aspect ratio that the camera is using. In future I may
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
void SimpleTexturedMaterial::load(const SceneComponentLoadContext &ctx) {
|
||||
void SimpleTexturedMaterial::load(SceneComponentLoadContext &ctx) {
|
||||
if(ctx.data.contains("color")) {
|
||||
this->setColor(JSON::color(ctx.data["color"]));
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ namespace Dawn {
|
||||
std::shared_ptr<Texture> texture;
|
||||
|
||||
public:
|
||||
void load(const SceneComponentLoadContext &ctx) override;
|
||||
void load(SceneComponentLoadContext &ctx) override;
|
||||
|
||||
/**
|
||||
* Returns the color of this material.
|
||||
|
@@ -27,7 +27,7 @@ void CubeMeshComponent::onDispose() {
|
||||
mesh = nullptr;
|
||||
}
|
||||
|
||||
void CubeMeshComponent::load(const SceneComponentLoadContext &ctx) {
|
||||
void CubeMeshComponent::load(SceneComponentLoadContext &ctx) {
|
||||
if(!mesh) mesh = std::make_shared<Mesh>();
|
||||
|
||||
}
|
@@ -14,6 +14,6 @@ namespace Dawn {
|
||||
|
||||
void onInit() override;
|
||||
void onDispose() override;
|
||||
void load(const SceneComponentLoadContext &ctx) override;
|
||||
void load(SceneComponentLoadContext &ctx) override;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user