Esempio n. 1
0
        public void Init(Action <List <Punchline>, Category> showCallback, GeneralPunchlines gamePunchlines, TMP_FontAsset streetAsset)
        {
            List <Punchline> temp = gamePunchlines.allPunchlines.Find(item => { return(item.category == category); }).punchlines;

            button.onClick.AddListener(() => showCallback.Invoke(temp, category));

            button.transform.GetChild(2).GetChild(0).GetChild(0).GetComponent <TextMeshProUGUI>().font = streetAsset;
            button.targetGraphic.color = GameData.GetColorFromCategory(category);
        }
Esempio n. 2
0
    public override void OnInspectorGUI()
    {
        editorTarget = target as GeneralPunchlines;

        if (!editorTarget.IsValid())
        {
            if (GUILayout.Button("Resets slots"))
            {
                editorTarget.FixPunchlines();
            }
        }

        if (GUILayout.Button("Export punchlines"))
        {
            ExtractPunchlines();
            Debug.Log("Punchlines extracted");
        }

        base.OnInspectorGUI();
    }
Esempio n. 3
0
    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");
    }