protected override void OnRegistered() { containerTransform = GameObject.FindGameObjectWithTag(containerTag).transform; lobbyScreen = Instantiate(lobbyScreenPrototype, containerTransform); battleScreen = Instantiate(battleScreenPrototype, containerTransform); lobbyScreen.Initialize(screenController); battleScreen.Initialize(screenController); }
protected override void OnRegistered() { container = GameObject.FindGameObjectWithTag(containerTag).GetComponent <InterfaceContainer>(); container.Register(); lobbyScreen = Instantiate(lobbyScreenPrototype, container.Root); battleScreen = Instantiate(battleScreenPrototype, container.Root); lobbyScreen.Initialize(screenController); battleScreen.Initialize(screenController); }
protected override void OnUnregister() { lobbyScreen.Deinitialize(screenController); battleScreen.Deinitialize(screenController); Destroy(lobbyScreen); Destroy(battleScreen); lobbyScreen = null; battleScreen = null; containerTransform = null; }