VRTowerDef/Plugins/MetaXR/Source/OculusXRProjectSetupTool/Private/Rules/OculusXRAnchorsRules.h

50 lines
1.6 KiB
C
Raw Normal View History

2024-05-29 08:53:41 +00:00
// Copyright (c) Meta Platforms, Inc. and affiliates.
#pragma once
#include "OculusXRSetupRule.h"
/*
* Collection of rules related to anchors. Can be extended as needed
*/
namespace OculusXRAnchorsRules
{
class FEnableAnchorSupportRule final : public ISetupRule
{
public:
FEnableAnchorSupportRule()
: ISetupRule(
"Feature_EnableAnchorSupport",
NSLOCTEXT("OculusXRAnchorsRules", "EnableAnchorSupport_DisplayName", "Enable Anchor Support"),
NSLOCTEXT("OculusXRAnchorsRules", "EnableAnchorSupport_Description", "Anchor support must be enabled when using anchor features"),
ESetupRuleCategory::Features,
ESetupRuleSeverity::Critical) {}
virtual bool IsApplied() const override;
virtual bool IsValid() override;
protected:
virtual void ApplyImpl(bool& OutShouldRestartEditor) override;
};
class FEnableSceneSupportRule final : public ISetupRule
{
public:
FEnableSceneSupportRule()
: ISetupRule(
"Feature_EnableSceneSupport",
NSLOCTEXT("OculusXRAnchorsRules", "EnableSceneSupport_DisplayName", "Enable Scene Support"),
NSLOCTEXT("OculusXRAnchorsRules", "EnableSceneSupport_Description", "Scene support must be enabled when using scene features"),
ESetupRuleCategory::Features,
ESetupRuleSeverity::Critical) {}
virtual bool IsApplied() const override;
virtual bool IsValid() override;
protected:
virtual void ApplyImpl(bool& OutShouldRestartEditor) override;
};
inline TArray<SetupRulePtr> AnchorRules_Table{
MakeShared<FEnableAnchorSupportRule>(),
MakeShared<FEnableSceneSupportRule>()
};
} // namespace OculusXRAnchorsRules