lib_unity_purchase/Editor/ServiceProjectSettings/Presenter/PurchasingEnabledState.cs

25 lines
826 B
C#
Raw Permalink Normal View History

2024-01-29 18:49:33 +08:00
namespace UnityEditor.Purchasing
{
class PurchasingEnabledState : BasePurchasingState
{
internal const string k_StateNameEnabled = "EnabledState";
public PurchasingEnabledState(SimpleStateMachine<bool> stateMachine)
: base(k_StateNameEnabled, stateMachine)
{
m_UIBlocks.Add(new GooglePlayConfigurationSettingsBlock());
m_UIBlocks.Add(new AppleConfigurationSettingsBlock());
m_UIBlocks.Add(new IapCatalogServiceSettingsBlock());
ModifyActionForEvent(false, HandleDisabling);
}
SimpleStateMachine<bool>.State HandleDisabling(bool raisedEvent)
{
return stateMachine.GetStateByName(PurchasingDisabledState.k_StateNameDisabled);
}
internal override bool IsEnabled() => true;
}
}