示例#1
0
    public override void Cancel(BaseScene.INPUT_TYPE type, JoystickManager.JOYSTICK_KEY_STATE keyState, JoystickManager.PLAYER_INDEX player)
    {
        Sounder.instance.Play("返回按键");
        if (keyState != JoystickManager.JOYSTICK_KEY_STATE.KEY_DOWN)
        {
            return;
        }

        if (alert.gameObject.activeSelf)
        {
            alert.gameObject.SetActive(false);
            return;
        }


        Sounder.instance.Play("返回按键");
        if (downloading)
        {
            confirm.Show(() =>
            {
                if (info != null)
                {
                    JLoader.instance.Remove(info);
                    info = null;
                    CharacterCard card = cards[characterIndex];
                    card.UpdateProgress(-1);
                    downloading = false;
                }
            }, "正在下载,要取消吗?");
        }
        else
        {
            BackToSongList();
        }
    }
示例#2
0
 public override void Cancel(BaseScene.INPUT_TYPE type, JoystickManager.JOYSTICK_KEY_STATE keyState, JoystickManager.PLAYER_INDEX player)
 {
     if (hasSelect)
     {
         return;
     }
     Sounder.instance.Play("返回按键");
     if (downloading)
     {
         confirm.Show(() => {
             if (info != null)
             {
                 JLoader.instance.Remove(info);
                 info = null;
                 CharacterCard card = cards[index - 1];
                 card.UpdateProgress(-1);
                 downloading = false;
             }
         }, "正在下载,要取消吗?");
     }
     else
     {
         LoadLevel("Prop", false);
     }
 }
示例#3
0
    private void DownloadVideo()
    {
        if (downloading)
        {
            return;
        }

        CharacterCard card = cards[characterIndex];

        card.undownload.gameObject.SetActive(false);

        if (Global.isAllResLocal)
        {
            downloading = false;
            if (confirm.gameObject.activeSelf)
            {
                confirm.gameObject.SetActive(false);
            }
            SetCharacter(characterIndex, true);
            return;
        }

        if (!Global.instance.CheckVideoDownload(card.data))
        {
            downloading = true;
            info        = Global.instance.DownloadVideo(card.data, (per) =>
            {
                if (per == -1)
                {
                    downloading = false;
                    alert.Show("网络异常或磁盘容量不足");
                    Sounder.instance.Play("BAD音效");
                    if (confirm.gameObject.activeSelf)
                    {
                        confirm.gameObject.SetActive(false);
                    }
                }
                else if (per == 1)
                {
                    downloading = false;
                    alert.Show("加载成功!");
                    if (confirm.gameObject.activeSelf)
                    {
                        confirm.gameObject.SetActive(false);
                    }
                }
                card.UpdateProgress(per);
            });
        }
        else
        {
            SetCharacter(characterIndex, true);
        }
    }