示例#1
0
    void endGame()
    {
        isDead       = true;
        forwardSpeed = 0;
        StartCoroutine(death());
        SkySpeedScript.setSpeed(0);
        EnemyPosScript.setSpeed(0);
        FirstLaunchScript.ins.SaveToCloud();
        AchievementManager.ins.killCount = 0;
        //EndScreenUI.setPanelActive();
        setEndScreenActive();
        if (distance > 10)
        {
            checkShowAd();
        }

        checkHiScore(distance);

        if (Social.localUser.authenticated)
        {
            Social.ReportScore((long)distance, CoffeeHerosResources.leaderboard_distance, (bool success) => { });
        }

        PlayerPrefs.SetInt("BonusBiscuits", 1);
        PlayerPrefs.Save();
    }
示例#2
0
 void startGame()
 {
     velocity      = Vector3.zero;
     forwardSpeed  = baseSpeed;
     isDead        = false;
     numOfLives    = 3;
     numOfShots    = 3;
     distance      = 0;
     timer         = 0;
     oneRunBiscuit = 0;
     SkySpeedScript.setSpeed(SkySpeedScript.constSpeed);
     EnemyPosScript.setSpeed(EnemyPosScript.constSpeed);
     isStart = false;
 }