Exemplo n.º 1
0
    IEnumerator LoadEditor(Dictionary <string, Sprite[]> packedSprites)
    {
        // Fade
        yield return(fader.fadeOut(1.0f));

        Skin skin = new Skin();

        LoadSettingsConfig(skin);

        skin.SetSpriteSheet(packedSprites);

        foreach (var skinItem in resourcesDictionary)
        {
            if (imagesToPack.ContainsKey(skinItem.Key))
            {
                continue;
            }

            skinItem.Value.AssignResource();

            // Add all loaded custom assets into the skin manager. Probably move this whole loading function into there later?
            skin.AddSkinItem(skinItem.Key, skinItem.Value.filepath, skinItem.Value.GetObject());
        }

        SkinManager.Instance.currentSkin = skin;

        // Load editor
        int buildIndex = UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex;

        enabled = false;
        fader   = null;
        UnityEngine.SceneManagement.SceneManager.LoadScene(buildIndex + 1);
    }
    IEnumerator LoadEditor()
    {
        // Fade
        yield return(fader.fadeOut(1.0f));

        Skin skin = new Skin();

        LoadSettingsConfig(skin);

        foreach (var skinItem in resourcesDictionary)
        {
            skinItem.Value.AssignResource();

            // Add all loaded custom assets into the skin manager. Probably move this whole loading function into there later?
            skin.AddSkinItem(skinItem.Key, skinItem.Value.filepath, skinItem.Value.GetObject());
        }

        // STANDARD NOTES
        for (int i = 0; i < skin.reg_strum.Length; ++i)
        {
            skin.reg_strum[i] = GetTextureFromLoadedResources(i + "_reg_strum", resourcesDictionary);
        }

        for (int i = 0; i < skin.reg_hopo.Length; ++i)
        {
            skin.reg_hopo[i] = GetTextureFromLoadedResources(i + "_reg_hopo", resourcesDictionary);
        }

        for (int i = 0; i < skin.reg_tap.Length; ++i)
        {
            skin.reg_tap[i] = GetTextureFromLoadedResources(i + "_reg_tap", resourcesDictionary);
        }

        for (int i = 0; i < skin.reg_cymbal.Length; ++i)
        {
            skin.reg_cymbal[i] = GetTextureFromLoadedResources(i + "_reg_cymbal", resourcesDictionary);
        }

        for (int i = 0; i < skin.sp_strum.Length; ++i)
        {
            skin.sp_strum[i] = GetTextureFromLoadedResources(i + "_sp_strum", resourcesDictionary);
        }

        for (int i = 0; i < skin.sp_hopo.Length; ++i)
        {
            skin.sp_hopo[i] = GetTextureFromLoadedResources(i + "_sp_hopo", resourcesDictionary);
        }

        for (int i = 0; i < skin.sp_tap.Length; ++i)
        {
            skin.sp_tap[i] = GetTextureFromLoadedResources(i + "_sp_tap", resourcesDictionary);
        }

        for (int i = 0; i < skin.sp_cymbal.Length; ++i)
        {
            skin.sp_cymbal[i] = GetTextureFromLoadedResources(i + "_sp_cymbal", resourcesDictionary);
        }

        // GHL LOADING
        for (int i = 0; i < skin.reg_strum_ghl.Length; ++i)
        {
            skin.reg_strum_ghl[i] = GetTextureFromLoadedResources(i + "_reg_strum_ghl", resourcesDictionary);
        }

        for (int i = 0; i < skin.reg_hopo_ghl.Length; ++i)
        {
            skin.reg_hopo_ghl[i] = GetTextureFromLoadedResources(i + "_reg_hopo_ghl", resourcesDictionary);
        }

        for (int i = 0; i < skin.reg_tap_ghl.Length; ++i)
        {
            skin.reg_tap_ghl[i] = GetTextureFromLoadedResources(i + "_reg_tap_ghl", resourcesDictionary);
        }

        for (int i = 0; i < skin.sp_strum_ghl.Length; ++i)
        {
            skin.sp_strum_ghl[i] = GetTextureFromLoadedResources(i + "_sp_strum_ghl", resourcesDictionary);
        }

        for (int i = 0; i < skin.sp_hopo_ghl.Length; ++i)
        {
            skin.sp_hopo_ghl[i] = GetTextureFromLoadedResources(i + "_sp_hopo_ghl", resourcesDictionary);
        }

        for (int i = 0; i < skin.sp_tap_ghl.Length; ++i)
        {
            skin.sp_tap_ghl[i] = GetTextureFromLoadedResources(i + "_sp_tap_ghl", resourcesDictionary);
        }

        SkinManager.Instance.currentSkin = skin;

        // Load editor
        int buildIndex = UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex;

        enabled = false;
        fader   = null;
        UnityEngine.SceneManagement.SceneManager.LoadScene(buildIndex + 1);
    }