From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Camera/OcclusionPortal.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Runtime/Camera/OcclusionPortal.h (limited to 'Runtime/Camera/OcclusionPortal.h') diff --git a/Runtime/Camera/OcclusionPortal.h b/Runtime/Camera/OcclusionPortal.h new file mode 100644 index 0000000..48bface --- /dev/null +++ b/Runtime/Camera/OcclusionPortal.h @@ -0,0 +1,37 @@ +#ifndef OCCLUSION_PORTAL_H +#define OCCLUSION_PORTAL_H + +#include "Runtime/GameCode/Behaviour.h" +#include "Runtime/Math/Vector3.h" + +class OcclusionPortal : public Unity::Component +{ +public: + REGISTER_DERIVED_CLASS (OcclusionPortal, Component) + DECLARE_OBJECT_SERIALIZE (OcclusionPortal) + + OcclusionPortal (MemLabelId label, ObjectCreationMode mode); + + void SetPortalIndex (int portalIndex) { m_PortalIndex = portalIndex; } + + void SetIsOpen (bool opened); + bool GetIsOpen () { return m_Open; } + + + Vector3f GetCenter () { return m_Center; } + Vector3f GetSize () { return m_Size; } + + bool CalculatePortalEnabled (); + + virtual void AwakeFromLoad (AwakeFromLoadMode mode); + virtual void Deactivate (DeactivateOperation operation); + + private: + + Vector3f m_Center; + Vector3f m_Size; + int m_PortalIndex; + bool m_Open; +}; + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0