// called when we get to the shogun panel void InitShogunPanel() { Skinning.ResetSkin(selectedSkin); if (shogunManager == null) { Debug.LogError(debuguableInterface.debugLabel + "ShogunManager component shouldn't be null. If we can't get scene references we can't do anything."); return; } EnemyBundle bundle = gameData.enemyContent.Find(item => { return(item.enemy == actualEnemy); }); GeneralDialogue selectedGeneral = bundle.shogunDialogue; selectedGeneral.Init(); CombatDialogue selectedCombat = bundle.combatDialogue; shogunManager.Init(useCheats, () => { popupManager.Pop(GamePopup.SHOGUN_DEDUCTION); audioProjectManager.FadeMusicOut(); }, audioProjectManager.FadePopupMusicIn); popupManager.GetPopupFromType <ShogunPopup>().SpecificInit( useCheats, selectedGeneral.GetAllClues(), selectedGeneral.unlockableConclusions, shogunManager.characters, selectedGeneral.goodDeityFeedback, selectedGeneral.badDeityFeedback, () => { popupManager.CancelPop(); audioProjectManager.FadeMusicIn(); }, () => { audioProjectManager.FadeMusicOut(); audioProjectManager.FadePopupMusicOut(); panelManager.JumpTo(GamePhase.FIGHT, () => { fightManager = FindObjectOfType <FightManager>(); fightManager.PreInit(selectedCombat); audioProjectManager.FadeMusicOut(); }); }, selectedCombat.actualState ); if (selectedCombat.actualState == GameState.NORMAL) { gameData.ResetPlayerClues(); } actualTutorial.Init(() => shogunManager.StartDialogue(selectedGeneral)); }
public override void OnInspectorGUI() { editorTarget = target as GeneralDialogue; if (!editorTarget.IsValid()) { if (GUILayout.Button("Reset slots")) { editorTarget.FixSlots(); } } base.OnInspectorGUI(); }
public void StartDialogue(GeneralDialogue dialogue) { if (!initialized) { Debug.LogError(debugableInterface.debugLabel + "Not initialized"); return; } scrollButton.button.interactable = true; actualDialogue = dialogue; characterPortrait.Show(); ChangeCharacter(Character.SHOGUN); firstCharacterSelection = false; characters.ForEach(item => item.UI.Grey(true)); }
public void PreInit(GameData.GameState targetState, GeneralDialogue dialogue, Func <Clue, bool> findClue) { findClueEvent = findClue; background.color = ColorTools.LerpColorValues(Skinning.GetSkin(SkinTag.PICTO), ColorTools.Value.SV, new int[2] { 8, 10 }); characterPortrait.Hide(); characters.ForEach(item => item.Init(() => ChangeCharacter(item.character))); ColorBlock block = dialogueScroll.colors; block.normalColor = Skinning.GetSkin(SkinTag.SECONDARY_ELEMENT); block.highlightedColor = Skinning.GetSkin(SkinTag.SECONDARY_WINDOW); block.pressedColor = Skinning.GetSkin(SkinTag.CONTRAST); dialogueScroll.colors = block; scrollButton.Init(this); block = scrollButton.button.colors; block.normalColor = Skinning.GetSkin(SkinTag.PRIMARY_ELEMENT); block.highlightedColor = Skinning.GetSkin(SkinTag.PRIMARY_WINDOW); block.pressedColor = Skinning.GetSkin(SkinTag.CONTRAST); block.disabledColor = block.normalColor; scrollButton.button.colors = block; // when you come back to shogun after defeat if (targetState != GameData.GameState.NORMAL) { // unlocks all clues foreach (Clue clue in dialogue.GetAllClues()) { findClue.Invoke(clue); AddClueToList(clue, true); } } actualState = targetState; }
public void Init(bool useCheats, GeneralPunchlines punchlines, GeneralDialogue dialogue, AudioProjectManager audioProject, Action toConsequencesCallback) { normalFont = FindObjectOfType <TextMeshProUGUI>().font; initializableInterface.InitInternal(); this.useCheats = useCheats; gamePunchlines = punchlines; toConsequences = toConsequencesCallback; audioProjectManager = audioProject; foreach (Transform child in sakuraParent) { child.GetComponent <Image>().color = sakuraColor; } katanaSlider.gameObject.SetActive(false); gongSlider.Init(() => { audioProjectManager.FadeMusicOut(0); AudioManager.PlaySound("Gong"); }, StartFinalPunchlines); lifePoints = new List <Animator>(); // spawns life points for (int i = 0; i < actualCombat.allowedErrors; i++) { Animator spawned = null; spawned = Instantiate(lifePrefab, triesHolder).GetComponent <Animator>(); lifePoints.Add(spawned); } categoryButtons.ForEach(item => item.Init(ShowPunchlines, gamePunchlines, streetFont)); spawnedConclusions = new List <ConclusionCard>(); // spawns conclusions foreach (Conclusion conclusion in dialogue.unlockableConclusions) { ConclusionCard spawned = Instantiate(conclusionPrefab, conclusionScroll); spawned.Init(conclusion); spawned.comment.font = streetFont; spawned.comment.wordSpacing = 5; spawnedConclusions.Add(spawned); } // finisher buttons for (int i = 0; i < finisherPunchlineButtons.Length; i++) { finisherPunchlineButtons[i].transform.GetChild(2).GetChild(0).GetComponent <TextMeshProUGUI>().text = actualCombat.finisherPunchlines.finishers[i]; finisherPunchlineButtons[i].transform.GetChild(2).GetChild(0).GetComponent <TextMeshProUGUI>().font = streetFont; finisherPunchlineButtons[i].transform.GetChild(2).GetChild(0).GetComponent <TextMeshProUGUI>().wordSpacing = 5; int j = i; finisherPunchlineButtons[i].onClick.AddListener(() => { selectedFinisher = actualCombat.finisherPunchlines.finishers[j]; isGoodFinisher = j == actualCombat.finisherPunchlines.correctOne; canvasAnimator.Play("PanDown"); Invoke("ShowAttackLines", 1); AudioManager.PlaySound("Button"); SetCanvasInterractable(false); actualPhase = Phase.EFFECT_FINAL; }); ColorBlock colors = finisherPunchlineButtons[i].colors; colors.normalColor = Skinning.GetSkin(SkinTag.SECONDARY_WINDOW); colors.highlightedColor = Skinning.GetSkin(SkinTag.PRIMARY_WINDOW); colors.pressedColor = Skinning.GetSkin(SkinTag.CONTRAST); finisherPunchlineButtons[i].colors = colors; } errorCount = 0; sakuraTimer = 0; trueSakuraDelay = UnityEngine.Random.Range(sakuraDelay.x, sakuraDelay.y); isGoodFinisher = false; gotToFinisher = false; invokedTransition = false; destructionAsked = false; isStartingGameOver = false; usedPunchlines = new List <Punchline>(); canvasAnimator.Play("Intro"); AudioManager.PlaySound("Wind"); Invoke("StartDialogue", 3); Debug.Log(debugableInterface.debugLabel + "Initializing done"); }