/// <summary> /// The callback to execute when we press the 'Tutorial' button /// </summary> /// <param name="baseObject"></param> private void OnTutorialButtonLeftClicked(BaseObject baseObject) { PlayerDataRegistryData startingRegistryData = AssetManager.GetData <PlayerDataRegistryData>(PlayerDataRegistry.startingDataRegistryDataAsset); Deck tutorialDeck = new Deck(); tutorialDeck.Create(startingRegistryData.Decks[0].CardDataAssets); Transition(new TutorialScreen(tutorialDeck)); }
/// <summary> /// The callback to execute when we choose our deck /// </summary> /// <param name="image"></param> private void ChooseDeckBoxClicked(BaseObject baseObject) { Debug.Assert(baseObject is UIObject); UIObject clickableImage = baseObject as UIObject; DebugUtils.AssertNotNull(clickableImage.StoredObject); Debug.Assert(clickableImage.StoredObject is Deck); // Create our opponent's deck using the cards in our mission data Deck opponentDeck = new Deck(); opponentDeck.Create(MissionData.OpponentDeckData.CardDataAssets); // Find the appropriate type of screen we should transition to based on the mission Type missionScreenType = Assembly.GetExecutingAssembly().GetType("SpaceCardGame." + MissionData.MissionName + "Mission"); DebugUtils.AssertNotNull(missionScreenType); // Transition to the new screen BattleScreen missionScreen = (BattleScreen)Activator.CreateInstance(missionScreenType, clickableImage.StoredObject as Deck, opponentDeck); ScreenManager.Instance.CurrentScreen.Transition(missionScreen); }