예제 #1
0
    private void HandleGameEnded()
    {
        if (FLogger.Ready)
        {
            FLogger.LogEvent(
                Firebase.Analytics.FirebaseAnalytics.EventLevelEnd,
                GetLevelName(),
                score.ToString()
                );
        }

        var random = new System.Random();

        if (random.Next(4) == 0)
        {
            PlayAd();
        }

        float timeElapsed = Time.time - startTime;

        this.finished = true;

        if (StateToFlag || StateToFlag || StateToCapital)
        {
            StateText.GetComponent <TextMeshProUGUI>().text = "";
            StateFlag.GetComponent <Image>().enabled        = false;
        }

        GameObject.Find("text").GetComponent <CrazyTextEffect>().SetTimeElapsed((int)timeElapsed);
        GameObject.Find("text").GetComponent <CrazyTextEffect>().SetScore(score);
        GameObject.Find("text").GetComponent <CrazyTextEffect>().play = true;
        BackButton.SetActive(true);
        BackButton.transform.GetChild(0).GetComponent <TextMeshProUGUI>().enabled = true;
        SoundController.PlayFinish();
    }
예제 #2
0
 private void HandleOnAdLoaded(object sender, EventArgs e)
 {
     Debug.Log("AD_LOADED");
     if (FLogger.Ready)
     {
         FLogger.LogEvent("AD_LOADED");
     }
 }
예제 #3
0
 private void HandleOnAdFailedToLoad(object sender, AdFailedToLoadEventArgs e)
 {
     Debug.Log("_______________________AD_FAILED_TO_LOAD with message: " + e.Message);
     if (FLogger.Ready)
     {
         FLogger.LogEvent("AD_FAILED_TO_LOAD");
     }
 }
예제 #4
0
 private void HandleOnAdOpened(object sender, EventArgs e)
 {
     Debug.Log("AD_OPENED");
     if (FLogger.Ready)
     {
         FLogger.LogEvent("AD_OPENED");
     }
 }
예제 #5
0
 private void HandleOnAdLeavingApplication(object sender, EventArgs e)
 {
     Debug.Log("AD_LEAVING_APPLICATION");
     if (FLogger.Ready)
     {
         FLogger.LogEvent("AD_LEAVING_APPLICATION");
     }
 }
예제 #6
0
 private void HandleOnAdClosed(object sender, EventArgs e)
 {
     Debug.Log("AD_CLOSED");
     if (FLogger.Ready)
     {
         FLogger.LogEvent("AD_CLOSED");
     }
     interstitial.Destroy();
 }
예제 #7
0
 private void OnApplicationQuit()
 {
     if (FLogger.Ready)
     {
         FLogger.LogEvent(
             "APP_CLOSE",
             Firebase.Analytics.FirebaseAnalytics.ParameterLevelName,
             GetLevelName()
             );
     }
 }
예제 #8
0
    private void StartGameFlow()
    {
        adController.RequestInterstitial();

        if (FLogger.Ready)
        {
            FLogger.LogEvent(
                Firebase.Analytics.FirebaseAnalytics.EventLevelStart,
                Firebase.Analytics.FirebaseAnalytics.ParameterLevelName,
                GetLevelName()
                );
        }
        StatesFlow = RandomizeStateList(new List <State>(States));

        if (StateToFlag || StateToCapital)
        {
            transform.GetComponentsInChildren <SpriteRenderer>().ToList()
            .ForEach(spriteRenderer => spriteRenderer.enabled = false);
        }
    }