示例#1
0
    public static ResultView Show(Transform parent, TitleConstData titleConstData, int score, Action onClickReturn)
    {
        var view = Create(parent);

        view.Initialize(titleConstData, score, true, onClickReturn);
        return(view);
    }
示例#2
0
    void Initialize(TitleConstData titleConstData, int score, bool gameEnded, Action onClickReturn)
    {
        if (titleConstData != null)
        {
            this.tweetScoreFormat = titleConstData.TweetScoreFormat;
            this.tweetMessage     = titleConstData.TweetMessage;
        }
        this.score         = score;
        this.gameEnded     = gameEnded;
        this.onClickReturn = onClickReturn;

        leaderboardView.gameObject.SetActive(false);
        tweetButton.SetActive(false);
        returnButton.SetActive(false);

        GetLeaderboard();

#if UNITY_ANDROID || UNITY_IOS
        if (gameEnded && Advertisement.IsReady())
        {
            var options = new ShowOptions();
            Advertisement.Show(options);
        }
#endif
    }
示例#3
0
    public void StartGame(Level level, TitleConstData titleConstData)
    {
        this.level          = level;
        this.titleConstData = titleConstData;
        scoreDisplay.Score  = 0;
        gotCoinCount        = 0;
        gotOneUpCount       = 0;
        if (level == Level.Expert)
        {
            scoreDisplay.Score = titleConstData.ExpertInitialScore;
            gotCoinCount       = titleConstData.ExpertInitialGotCoinCount;
        }

        foreach (var vertex in vertexes)
        {
            vertex.ResetColor();
        }
        selectedVertex = null;

        balls = new List <Ball>();
        AddNewBall();

        if (wall != null)
        {
            Destroy(wall.gameObject);
            wall = null;
        }
        if (coin != null)
        {
            Destroy(coin.gameObject);
            coin = null;
        }
        if (oneUp != null)
        {
            Destroy(oneUp.gameObject);
            oneUp = null;
        }

        var startCountdownView = Instantiate(startCountdownViewPrefab, guideCanvas.transform);

        startCountdownView.Initialize(() => {
            balls[0].StartMove(FirstBallStartForce(), titleConstData.MaxVelocity);

            AudioManagerSingleton.Instance.PlayBgm();
        });
    }