public void Update_score()//call from initiate_ugui(), Order_to_gems_to_explode(), tile_C.Update_tile_hp()
    {
        gui_player_score.text = player_score.ToString("N0");

        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            LoLController.instance.score = player_score;
        }


        if (continue_to_play_after_win_until_lose_happen && player_win)
        {
            if (win_requirement_selected != win_requirement.collect_gems)
            {
                if ((current_star_score < 3) && (player_score >= three_stars_target_score))
                {
                    current_star_score = 3;
                }
                else if ((current_star_score < 2) && (player_score >= two_stars_target_score))
                {
                    current_star_score = 2;
                }
            }
        }

        if (Stage_uGUI_obj)//use menu kit win screen
        {
            /* if you have the menu kit, DELETE THIS LINE
             *                  my_game_uGUI.int_score = player_score;
             *                  my_game_uGUI.Update_int_score();
             *
             *          // if you have the menu kit, DELETE THIS LINE */
        }
    }
Exemple #2
0
 public void LOLSubmitProgressWithCurrentScore(int progress)
 {
     if (LoLController.Exists() && LoLController.instance.isUsingLoL)
     {
         LoLSDK.LOLSDK.Instance.SubmitProgress(LoLController.instance.score, progress, _maxProgress);
     }
 }
Exemple #3
0
 public void LOLSubmitProgressWithCurrentScore(int progress)
 {
     if (LoLController.Exists() && LoLController.instance.isUsingLoL)
     {
         LoLController.instance.LOLSubmitProgressWithCurrentScore(progress);
     }
 }
Exemple #4
0
    void Start()
    {
        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            score = LoLController.instance.score;
        }

        if (AudioController.Exists())
#if UNITY_WEBGL
        { AudioController.instance.SetBGM_Name(_bgmStr); }
#else
        { AudioController.instance.SetBGMClip(_bgmClip); }
#endif

#if UNITY_WEBGL
        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            switch (currentStage)
            {
            case 1:
                LOLSubmitProgressWithCurrentScore(1);
                break;

            case 2:
                LOLSubmitProgressWithCurrentScore(4);
                break;

            case 3:
                LOLSubmitProgressWithCurrentScore(6);
                break;
            }
        }
#endif
    }
Exemple #5
0
 public void PlaySfx(string my_clip_str)
 {
     if (LoLController.Exists() && LoLController.instance.isUsingLoL)
     {
         LOLSDK.Instance.PlaySound(my_clip_str);
     }
 }
Exemple #6
0
 public void Play_sfx(string my_clip_str)
 {
     Debug.Log("Play sfx = " + my_clip_str);
     if (LoLController.Exists() && LoLController.instance.isUsingLoL)
     {
         LoLSDK.LOLSDK.Instance.PlaySound(my_clip_str);
     }
 }
Exemple #7
0
    public void StopBGM()
    {
#if UNITY_WEBGL
        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            LoLSDK.LOLSDK.Instance.StopSound(bgmNameString);
        }
#else
        bgmSource.Stop();
#endif
    }
Exemple #8
0
    public void PlayBGM()
    {
#if UNITY_WEBGL
        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            LoLSDK.LOLSDK.Instance.PlaySound(bgmNameString, true, true);
        }
#else
        bgmSource.Play();
#endif
    }
Exemple #9
0
    public void EndGame()
    {
#if UNITY_WEBGL
        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            LOLSubmitProgressWithCurrentScore(9);
            LoLSDK.LOLSDK.Instance.CompleteGame();
        }
#endif
        SceneManager.LoadScene("mainmenu");
    }
Exemple #10
0
    void Initiate_variables()//call from Awake
    {
        Reset_variables();
        this_board = this;

        AudioSource[] sources = GetComponents <AudioSource>();
        audioSrcList.AddRange(sources);

        cursor.gameObject.SetActive(false);

        number_of_bottom_tiles = new int[4];

        //emission rules
        Initiate_emitter_variables();

        //gem count
        total_number_of_gems_destroyed_by_the_player  = new int[gem_length];
        number_of_gems_collect_by_the_player          = new int[gem_length];
        number_of_gems_collect_by_the_player_in_frame = new int[gem_length];
        additional_gems_collected_by_the_player       = 0;

        //score
        current_star_score = 0;
        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            player_score = LoLController.instance.score;
        }
        else
        {
            player_score = 0;
        }
        enemy_score = 0;

        if (number_of_gems_to_destroy_to_win.Length == 0)
        {
            number_of_gems_to_destroy_to_win = new int[gem_length];
        }

        player_this_gem_color_is_collected = new bool[gem_length];

        for (int n = 0; n < gem_length; n++)
        {
            total_number_of_gems_remaining_for_the_player += number_of_gems_to_destroy_to_win[n];
        }
        total_number_of_gems_required_colletted = 0;


        time_left = timer;


        Initiate_ugui();
    }
Exemple #11
0
    public void SetBGM_Name(string bgmName)
    {
#if UNITY_WEBGL
        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            LoLSDK.LOLSDK.Instance.StopSound(bgmNameString);
        }

        bgmNameString = bgmName;

        PlayBGM();
#endif
    }
Exemple #12
0
    // Use this for initialization
    void Start()
    {
#if UNITY_WEBGL
        if (AudioController.Exists())
        {
            AudioController.instance.SetBGM_Name(bgm_str);
        }
#endif

        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            LoLController.instance.LOLSubmitProgressWithCurrentScore(0);
            LoLController.instance.score = 0;
        }
    }
    public void OnElementCompleted(ElementType eleType)
    {
        if (needToshow)
        {
#if UNITY_WEBGL
            if (LoLController.Exists() && LoLController.instance.isUsingLoL)
            {
                gameCtrl.LOLSubmitProgressWithCurrentScore(2);
            }
#endif
            if (!gameCtrl.dialogCtrl.isShown)
            {
                gameCtrl.dialogCtrl.PlaySequence(6, true);
            }


            _eleList.Add(eleType);
        }
    }
Exemple #14
0
    void OnDestroy()
    {
        AudioController.OnSoundChanged -= OnSoundChanged;
#if UNITY_WEBGL
        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            switch (currentStage)
            {
            case 1:
                LOLSubmitProgressWithCurrentScore(3);
                break;

            case 2:
                LOLSubmitProgressWithCurrentScore(5);
                break;

            case 3:
                LOLSubmitProgressWithCurrentScore(7);
                break;
            }
        }
#endif
    }