3 #include "ISceneElementInGraphObserver.h"
4 #include "SceneElement.h"
5 #include "UnityCallbacks.h"
11 template <
class TRenderableType>
12 class UnitySceneGraphObserver :
public Rendering::Scene::ISceneElementInGraphObserver<TRenderableType>
16 UnitySceneGraphObserver(
const MeshCallbacks& meshCallbacks)
17 : m_meshCallbacks(meshCallbacks)
24 void SetVisible(
const std::string& resourceName,
bool visible)
26 m_meshCallbacks.SetVisible(resourceName.c_str(), visible);
29 void OnAddedToSceneGraph(Rendering::Scene::SceneElement<TRenderableType>* resource)
override
31 SetVisible(resource->GetName(),
true);
34 void OnRemovedFromSceneGraph(Rendering::Scene::SceneElement<TRenderableType>* resource)
override
36 SetVisible(resource->GetName(),
false);
39 const MeshCallbacks& m_meshCallbacks;