| | 1 | | using System; |
| | 2 | | using System.Collections; |
| | 3 | | using System.Collections.Generic; |
| | 4 | | using DCL; |
| | 5 | | using Newtonsoft.Json; |
| | 6 | | using UnityEngine; |
| | 7 | |
|
| | 8 | | public class FeatureFlagBridge : MonoBehaviour |
| | 9 | | { |
| | 10 | | public void SetFeatureFlagConfiguration(string json) |
| | 11 | | { |
| 0 | 12 | | FeatureFlag config = null; |
| | 13 | | try |
| | 14 | | { |
| 0 | 15 | | config = JsonConvert.DeserializeObject<FeatureFlag>(json); |
| 0 | 16 | | } |
| 0 | 17 | | catch (Exception e) |
| | 18 | | { |
| 0 | 19 | | Debug.LogError("FeatureFlag has been unable to parse the json! Error: " + e); |
| 0 | 20 | | } |
| | 21 | |
|
| 0 | 22 | | SetFeatureFlagConfiguration(config); |
| 0 | 23 | | } |
| | 24 | |
|
| | 25 | | public void SetFeatureFlagConfiguration(FeatureFlag config) |
| | 26 | | { |
| 1 | 27 | | if (config == null) |
| 0 | 28 | | return; |
| | 29 | |
|
| 1 | 30 | | DataStore.i.featureFlags.flags.Set(config); |
| 1 | 31 | | } |
| | 32 | | } |