| | 1 | | using DCL; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | public class FeatureFlagController : IFeatureFlagController |
| | 5 | | { |
| | 6 | | internal FeatureFlagBridge featureFlagBridgeComponent; |
| | 7 | | internal GameObject bridgeGameObject; |
| | 8 | |
|
| 630 | 9 | | public FeatureFlagController(GameObject bridgeGameObject = null) |
| | 10 | | { |
| 630 | 11 | | if ( bridgeGameObject == null ) |
| | 12 | | { |
| 629 | 13 | | if (SceneReferences.i != null) |
| 629 | 14 | | bridgeGameObject = SceneReferences.i.bridgeGameObject; |
| | 15 | | } |
| | 16 | |
|
| 630 | 17 | | this.bridgeGameObject = bridgeGameObject; |
| | 18 | |
|
| 630 | 19 | | if (bridgeGameObject == null) |
| 577 | 20 | | return; |
| | 21 | |
|
| 53 | 22 | | AddBridgeComponent(bridgeGameObject); |
| 53 | 23 | | } |
| | 24 | |
|
| | 25 | | public void AddBridgeComponent(GameObject gameObjectToAddBridge) |
| | 26 | | { |
| 53 | 27 | | if (gameObjectToAddBridge == null) |
| 0 | 28 | | return; |
| | 29 | |
|
| 53 | 30 | | if (featureFlagBridgeComponent != null) |
| 0 | 31 | | Dispose(); |
| | 32 | |
|
| 53 | 33 | | featureFlagBridgeComponent = gameObjectToAddBridge.AddComponent<FeatureFlagBridge>(); |
| 53 | 34 | | } |
| | 35 | |
|
| | 36 | | public void Dispose() |
| | 37 | | { |
| 630 | 38 | | Object.Destroy(bridgeGameObject); |
| 630 | 39 | | bridgeGameObject = null; |
| 630 | 40 | | featureFlagBridgeComponent = null; |
| 630 | 41 | | } |
| | 42 | |
|
| | 43 | | public void Initialize() |
| | 44 | | { |
| 629 | 45 | | } |
| | 46 | | } |