示例#1
0
 public void LOLSubmitProgressWithCurrentScore(int progress)
 {
     if (LoLController.Exists() && LoLController.instance.isUsingLoL)
     {
         LoLSDK.LOLSDK.Instance.SubmitProgress(LoLController.instance.score, progress, _maxProgress);
     }
 }
示例#2
0
    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 */
        }
    }
示例#3
0
 public void OnDestroy()
 {
     if (s_Instance == this)
     {
         s_Instance = null;
     }
 }
示例#4
0
 public void PlaySfx(string my_clip_str)
 {
     if (LoLController.Exists() && LoLController.instance.isUsingLoL)
     {
         LOLSDK.Instance.PlaySound(my_clip_str);
     }
 }
示例#5
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
    }
示例#6
0
 public void LOLSubmitProgressWithCurrentScore(int progress)
 {
     if (LoLController.Exists() && LoLController.instance.isUsingLoL)
     {
         LoLController.instance.LOLSubmitProgressWithCurrentScore(progress);
     }
 }
示例#7
0
        public async Task Ranked([Summary("Summoner name")] string summonerName)
        {
            var msg = Context.Message;

            if (summonerName.IsNullOrEmpty())
            {
                using (var db = new LiteDatabase(@"LoL.db"))
                {
                    var summoners = db.GetCollection <LoLSummoner>("lolsummoners");

                    var summoner        = summoners.Find(x => x.DiscordID.Equals(msg.Author.Id));
                    var loLSummoners    = summoner as LoLSummoner[] ?? summoner.ToArray();
                    var discordSummoner = loLSummoners[0];

                    var summonerApi = LoLController.GetSummonerData(discordSummoner.SummonerID.ToString());
                    var message     = LoLController.GetRankedStats(summonerApi);
                    await ReplyAsync(message);
                }
            }
            else
            {
                var summonerApi = LoLController.GetSummonerData(summonerName);
                var message     = LoLController.GetRankedStats(summonerApi);
                await ReplyAsync(message);
            }
        }
示例#8
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);
     }
 }
示例#9
0
    public void PlayBGM()
    {
#if UNITY_WEBGL
        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            LoLSDK.LOLSDK.Instance.PlaySound(bgmNameString, true, true);
        }
#else
        bgmSource.Play();
#endif
    }
示例#10
0
    public void StopBGM()
    {
#if UNITY_WEBGL
        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            LoLSDK.LOLSDK.Instance.StopSound(bgmNameString);
        }
#else
        bgmSource.Stop();
#endif
    }
示例#11
0
    public void EndGame()
    {
#if UNITY_WEBGL
        if (LoLController.Exists() && LoLController.instance.isUsingLoL)
        {
            LOLSubmitProgressWithCurrentScore(9);
            LoLSDK.LOLSDK.Instance.CompleteGame();
        }
#endif
        SceneManager.LoadScene("mainmenu");
    }
示例#12
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();
    }
示例#13
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
    }
示例#14
0
    public static bool Exists()
    {
        if (s_Instance == null)
        {
            LoLController tmpInst = FindObjectOfType(typeof(LoLController)) as LoLController;
            if (tmpInst != null)
            {
                tmpInst.Awake();
            }
            s_Instance = tmpInst;
        }

        return(s_Instance != null);
    }
示例#15
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;
        }
    }
示例#16
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);
        }
    }
示例#17
0
        public async Task SetSummoner([Summary("Summoner name")] string summonerName)
        {
            var msg = Context.Message;

            try
            {
                var summonerDetails = LoLController.GetSummonerData(summonerName);

                using (var db = new LiteDatabase(@"LoL.db"))
                {
                    var summoners = db.GetCollection <LoLSummoner>("lolsummoners");

                    var summoner = new LoLSummoner
                    {
                        Id         = msg.Author.Id,
                        DiscordID  = msg.Author.Id,
                        SummonerID = (int)summonerDetails.Id
                    };

                    var isNew = summoners.Find(x => x.Id.Equals(msg.Author.Id));

                    if (isNew.Any())
                    {
                        summoners.Update(summoner);
                    }
                    else
                    {
                        summoners.Insert(summoner);
                    }
                }

                await ReplyAsync(string.Format(Resources.response_Linked_LolAccount, summonerName));
            }
            catch (RiotSharpException ex)
            {
                // Handle the exception however you want.
                Console.WriteLine(ex);
            }
        }
示例#18
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
    }
示例#19
0
    //----------------------------------------------------------------
    // End Singleton code
    //----------------------------------------------------------------

    void Awake()
    {
        if (m_awake)
        {
            return;
        }
        m_awake = true;

        // See if we are a superfluous instance:
        if (s_Instance != null)
        {
            Debug.LogError("You can only have one instance of this singleton object in existence.");
        }
        else
        {
            s_Instance = this;
        }

        DontDestroyOnLoad(this.gameObject);

        Application.targetFrameRate = -1;

        if (_isUsingLoL)
        {
            Startup();
        }

        if (_isDisplayingPerformanceTool)
        {
            LOLSDK.Instance.DisplayPerformanceTestTool();
        }

        if (!string.IsNullOrEmpty(_sceneAfterInit))
        {
            SceneManager.LoadScene(_sceneAfterInit);
        }
    }