protected void FoundClue(ClueData clue)
    {
        CaseData openedCase = InvestigationManager.GetCase();
        int      clueIndex  = openedCase.GetClueIndexFromData(clue);

        if (clueIndex >= 0)
        {
            Files files = Files.Load();
            bool  added = files.GetCaseStatus().AddClue(openedCase.GetClueIndexFromData(clue));
            files.Save();
            Debug.Log("ADDED: " + added);
            DialogUI.StartDialog(clue.findingDialog, added, DialogType.CLUE);
        }
        else
        {
            NoClueFound();
        }
    }
Ejemplo n.º 2
0
    public void SetObject(ClueData clue, bool full = true)
    {
        CaseData openedCase = InvestigationManager.GetCase();

        GetComponent <CanvasGroup>().alpha = 1;
        string fullDescription = clue.clueDescription;
        Files  files           = Files.Load();

        if (full)
        {
            int clueIndex = openedCase.GetClueIndexFromData(clue);
            fullDescription += "\n\nTESTEMUNHOS:";
            foreach (Testimony t in files.GetCaseStatus().testimonys)
            {
                if (t.clue == clueIndex)
                {
                    TestimonyData td = openedCase.GetTestimonyData(t);
                    fullDescription += "\n" + "* " + td.witness.witnessName + ": " + td.description;
                }
            }
            fullDescription += "\n\nINSIGHTS:";
            foreach (int i in files.GetCaseStatus().insights)
            {
                InsightData id = openedCase.GetInsightData(i);
                if ((openedCase.GetClueIndexFromData(id.firstClue) == clueIndex) ||
                    (openedCase.GetClueIndexFromData(id.secondClue) == clueIndex))
                {
                    fullDescription += "\n* [" + id.firstClue.clueName + ":" + id.secondClue.clueName + "]"
                                       + id.description;
                }
            }
        }
        description.text = fullDescription;
        title.text       = clue.clueName;
        icon.sprite      = clue.img;
    }