コード例 #1
0
    void gameOver(bool win)
    {
        this.resultPanel.SetActive(true);
        if (win)
        {
            resultText.text = "Поздравляем, вы победили!";
        }
        else
        {
            resultText.text = "К сожалению, вы проиграли... Попробуйте еще раз!";
        }
        // сохранить в рейтинг

        for (int x = 0; x < this.xSize; x++)
        {
            for (int y = 0; y < this.ySize; y++)
            {
                tiles[x, y].SetActive(false);
            }
        }
        this.shagCountText.gameObject.SetActive(false);
        this.totalPointsText.gameObject.SetActive(false);
        this.surrenderButton.gameObject.SetActive(false);

#if UNITY_EDITOR
        var lstGames = GameListManager.readCsvFile(AssetDatabase.GetAssetPath(csvFile));
        GameListManager.writeLine(new GameHistoryModel(lstGames.Count, System.DateTime.Now, this.totalPoints, win),
                                  AssetDatabase.GetAssetPath(csvFile));
#endif
    }
コード例 #2
0
    // Start is called before the first frame update
    void Start()
    {
        backButton.onClick.AddListener(back);
#if UNITY_EDITOR
        var lstGames = GameListManager.readCsvFile(AssetDatabase.GetAssetPath(csvFile));
        if (lstGames == null)
        {
            Debug.LogError("Something go wrong!");
            return;
        }
        lstGames.ForEach(game => {
            this.createNewTextObject(game.FormatLineForRecordsList);
        });
#endif
    }