Beispiel #1
0
    private void OnClickItem()
    {
        LogInteracao item = new LogInteracao(
            nomeObjeto,
            descricaoObjeto,
            GameController.instance.GetLocal(),
            System.DateTime.Now
            );

        GameController.instance.SaveComportamento(ComportamentosType.item, item);
    }
    LogInteracao CarregarLogs()
    {
        LogInteracao logInteracao = new LogInteracao();

        logInteracao.containerSeteErros        = containerSE;
        logInteracao.containerPerseguicaoSaci  = containerPS;
        logInteracao.containerPalavraCruzada   = containerPC;
        logInteracao.containerBlocosDeFeno     = containerBF;
        logInteracao.containerAssobios         = containerA;
        logInteracao.containerPegadasEstranhas = containerPE;
        logInteracao.containerAcerteOFogo      = containerAOF;
        logInteracao.containerForca            = containerF;
        logInteracao.containerEscondeEsconde   = containerEE;
        logInteracao.containerGiraDisco        = containerGD;
        logInteracao.containerPinball          = containerP;
        return(logInteracao);
    }
    public void ExportarArquivoLogs()
    {
        LogInteracao log       = CarregarLogs();
        string       logJson   = JsonUtility.ToJson(log, true);
        string       diretorio = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) + @"/" + "ArquivosLume" + @"/" + "LogInteração.json";

        if (!Directory.Exists(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) + @"/" + "ArquivosLume"))
        {
            Directory.CreateDirectory(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop) + @"/" + "ArquivosLume");
        }

        using (StreamWriter writer = new StreamWriter(diretorio, false))
        {
            writer.Write(logJson);
        }
        Debug.Log(logJson);
    }