public LeaderboardManipulator(HMSSettings settings)
 {
     _settings        = settings;
     _leaderboardList = new List <HMSLeaderboardEntry>();
     for (int i = 0; i < settings.Keys.Count(); i++)
     {
         _leaderboardList.Add(new HMSLeaderboardEntry(_settings.Keys.ElementAt(i), _settings.Values.ElementAt(i)));
     }
 }
        public HMSIAPProductListSettings()
        {
            loadedSettings = ScriptableHelper.Load <SettingsScriptableObject>(SettingsFilename, "Assets/Huawei/Settings/Resources");

            Debug.Assert(loadedSettings != null, "Failed to load the " + SettingsFilename);
            _settings = loadedSettings.settings;

            _settings.OnDictionaryChanged += _settings_OnDictionaryChanged;
        }
示例#3
0
 public IAPProductManipulator(HMSSettings settings)
 {
     _settings    = settings;
     _productList = new List <HMSIAPProductEntry>();
     for (int i = 0; i < _settings.Keys.Count(); i++)
     {
         _productList.Add(new HMSIAPProductEntry(_settings.Keys.ElementAt(i), (HMSIAPProductType)Enum.Parse(typeof(HMSIAPProductType), _settings.Values.ElementAt(i))));
     }
 }
示例#4
0
 public AchievementManipulator(HMSSettings settings)
 {
     _settings        = settings;
     _achievementList = new List <HMSAchievementEntry>();
     for (int i = 0; i < settings.Keys.Count(); i++)
     {
         _achievementList.Add(new HMSAchievementEntry(_settings.Keys.ElementAt(i), _settings.Values.ElementAt(i)));
     }
 }
        public DefaultValueManipulator(HMSSettings settings)
        {
            _settings      = settings;
            _defaultValues = new List <DefaultValue>();

            for (int i = 0; i < _settings.Keys.Count(); i++)
            {
                _defaultValues.Add(new DefaultValue(_settings.Keys.ElementAt(i), _settings.Values.ElementAt(i)));
            }
        }
示例#6
0
        public HMSIAPSettingsDrawer()
        {
            _iapSettings             = HMSIAPKitSettings.Instance.Settings;
            _productListSettings     = HMSIAPProductListSettings.Instance.Settings;
            _productManipulator      = new IAPProductManipulator(_productListSettings);
            _initializeOnStartToggle = new Toggle.Toggle("Initialize On Start*", HMSIAPKitSettings.Instance.Settings.GetBool(HMSIAPKitSettings.InitializeOnStart), OnInitializeOnStartToggle).SetTooltip("Obtains product info in Start function.");

            _productManipulator.OnRefreshRequired += OnIAPProductChanged;
            OnIAPProductChanged();
            SetupSequence();
        }
示例#7
0
        public HMSRemoteConfigSettingsDrawer()
        {
            _defaultValueSettings     = HMSRemoteDefaultValueSettings.Instance.Settings;
            _remoteConfigSettings     = HMSRemoteConfigSettings.Instance.Settings;
            _defaultValueManipulator  = new DefaultValueManipulator(_defaultValueSettings);
            _developerModeToggle      = new Toggle.Toggle("Developer Mode", _remoteConfigSettings.GetBool(HMSRemoteConfigSettings.DeveloperMode), OnDeveloperModeToggle);
            _applyDefaultValuesToggle = new Toggle.Toggle("Apply Default Values*", _remoteConfigSettings.GetBool(HMSRemoteConfigSettings.ApplyDefaultValues), OnApplyDefaultValuesToggle).SetTooltip("This will apply default values on start");

            _defaultValueManipulator.OnRefreshRequired += OnDefaultValueChanged;

            OnDefaultValueChanged();
            SetupSequence();
        }
        public void PrepareGradleFile()
        {
            HMSSettings   settings = HMSMainEditorSettings.Instance.Settings;
            List <string> gradle   = new List <string>(CoreGradles());

            for (int i = 0; i < settings.Keys.Count(); i++)
            {
                if (settings.Values.ElementAt(i) == true.ToString())
                {
                    gradle.AddRange(gradleSettings[settings.Keys.ElementAt(i)]);
                }
            }
            CreateGradleFiles(gradle.ToArray());
        }
        public HMSGameServiceSettingsDrawer()
        {
            _leaderboardSettings    = HMSLeaderboardSettings.Instance.Settings;
            _achievementsSettings   = HMSAchievementsSettings.Instance.Settings;
            _leaderboardManipulator = new LeaderboardManipulator(_leaderboardSettings);
            _achievementManipulator = new AchievementManipulator(_achievementsSettings);

            _leaderboardManipulator.OnRefreshRequired += OnLeaderboardListChanged;
            _achievementManipulator.OnRefreshRequired += OnAchievementListChanged;

            OnLeaderboardListChanged();
            OnAchievementListChanged();
            SetupSequence();
        }
        public HMSAdsSettingsDrawer()
        {
            _settings = HMSAdsKitSettings.Instance.Settings;
            _enableBannerAdsToggle    = new Toggle.Toggle("Enable Banner Ads", _settings.GetBool(HMSAdsKitSettings.EnableBannerAd), OnBannerAdsToggleChanged, false);
            _bannerAdsTextField       = new TextFieldWithAccept("Banner Ad ID", _settings.Get(HMSAdsKitSettings.BannerAdID), "Save", OnBannerAdIDSaveButtonClick).SetLabelWidth(0).SetButtonWidth(100);
            _bannerAdsRefreshField    = new TextFieldWithAccept("Banner Refresh Interval*", _settings.Get(HMSAdsKitSettings.BannerRefreshInterval), "Save", OnBannerRefreshIntervalSaveButtonClick).SetLabelWidth(0).SetButtonWidth(100).AddTooltip("Default is 60 seconds. Value can be between 30 and 120 seconds");
            _enableBannerAdLoadToggle = new Toggle.Toggle("Show Banner on Load*", _settings.GetBool(HMSAdsKitSettings.ShowBannerOnLoad), OnShowBannerOnLoadChanged, false).SetTooltip("Enabling this will make the banner to be shown right after it finishes loading.");
            _bannerAdsDisabledDrawer  = new DisabledDrawer(new VerticalSequenceDrawer(_bannerAdsTextField, _bannerAdsRefreshField, _enableBannerAdLoadToggle)).SetEnabled(!_enableBannerAdsToggle.IsChecked());

            _enableInterstitialAdsToggle   = new Toggle.Toggle("Enable Interstitial Ads", _settings.GetBool(HMSAdsKitSettings.EnableInterstitialAd), OnInterstitialAdsToggleChanged, false);
            _interstitialAdsTextField      = new TextFieldWithAccept("Interstitial Ad ID", _settings.Get(HMSAdsKitSettings.InterstitialAdID), "Save", OnInterstitialAdIDSaveButtonClick).SetLabelWidth(0).SetButtonWidth(100);
            _interstitialAdsDisabledDrawer = new DisabledDrawer(_interstitialAdsTextField).SetEnabled(!_enableInterstitialAdsToggle.IsChecked());

            _enableRewardedAdsToggle   = new Toggle.Toggle("Enable Rewarded Ads", _settings.GetBool(HMSAdsKitSettings.EnableRewardedAd), OnRewardedAdsToggleChanged, false);
            _rewardedAdsTextField      = new TextFieldWithAccept("Rewarded Ad ID", _settings.Get(HMSAdsKitSettings.RewardedAdID), "Save", OnRewardedAdIDSaveButtonClick).SetLabelWidth(0).SetButtonWidth(100);
            _rewardedAdsDisabledDrawer = new DisabledDrawer(_rewardedAdsTextField).SetEnabled(!_enableRewardedAdsToggle.IsChecked());

            _testAdstoggle = new Toggle.Toggle("Use Test Ads*", _settings.GetBool(HMSAdsKitSettings.UseTestAds), OnTestAdsToggleChanged);
            _testAdstoggle.SetTooltip("This will overwrite all ads with test ads.");
            SetupSequence();
        }