public void Initialize() { _userInterfaceCanvasInstance = Instantiate(UserInterfaceCanvasPrefab); _windowsCanvasInstance = Instantiate(WindowsCanvasPrefab); _userInterfaceViewInstance = InstantiateElement(UserInterfaceViewPrefab, _userInterfaceCanvasInstance.transform); GameManager.Instance.GameFlowManager.CurrentGameStatusChanged += CurrentGameFlowManagerOnCurrentGameStatusChanged; }
public MainWindow() { Instance = this; InitializeComponent(); Border = BLUE_BRUSH; StatusbarText = STATUS_IDLE; var view = new UserInterfaceView(new UserInterfaceViewModel()); GridUserControlLayout.Children.Add(view); }
public void Uninitialize() { if (_userInterfaceCanvasInstance != null) { Destroy(_userInterfaceCanvasInstance.gameObject); _userInterfaceCanvasInstance = null; } if (_userInterfaceViewInstance) { Destroy(_userInterfaceViewInstance.gameObject); _userInterfaceViewInstance = null; } GameManager.Instance.GameFlowManager.CurrentGameStatusChanged -= CurrentGameFlowManagerOnCurrentGameStatusChanged; if (_gameOverWindowViewInstance != null) { Destroy(_gameOverWindowViewInstance.gameObject); _gameOverWindowViewInstance.Uninitialize(); _gameOverWindowViewInstance = null; } }