Beispiel #1
0
    bool CheckTextureInSkin()
    {
        Skin customSkin = SkinManager.Instance.currentSkin;

        Note note = nCon.note;

        Note.NoteType    noteType    = NoteVisualsManager.GetVisualNoteType(note);
        Note.SpecialType specialType = NoteVisualsManager.IsStarpower(note);

        int arrayPos = NoteVisuals2DManager.GetNoteArrayPos(note);

        Note.NoteType visualNoteType = noteType;

        if (!Globals.ghLiveMode)
        {
            if (noteType == Note.NoteType.Hopo && Globals.drumMode)
            {
                visualNoteType = Note.NoteType.Strum;
            }
        }

        string noteKey = NoteVisuals2DManager.GetSkinKey(arrayPos, noteType, specialType, Globals.ghLiveMode);

        Sprite[] sprites = SkinManager.Instance.currentSkin.GetSprites(noteKey);

        return(sprites != null && sprites.Length > 0);
    }
    bool CheckTextureInSkin()
    {
        Skin customSkin = SkinManager.Instance.currentSkin;

        Note note = nCon.note;

        Note.NoteType    noteType    = NoteVisualsManager.GetVisualNoteType(note);
        Note.SpecialType specialType = NoteVisualsManager.IsStarpower(note);

        int arrayPos = NoteVisuals2DManager.GetNoteArrayPos(note, ChartEditor.Instance.laneInfo);

        Note.NoteType visualNoteType = noteType;

        if (!Globals.ghLiveMode)
        {
            if (noteType == Note.NoteType.Hopo && Globals.drumMode)
            {
                visualNoteType = Note.NoteType.Strum;
            }
        }

        bool isInSkin;
        bool isGhl = Globals.ghLiveMode;
        int  hash  = NoteVisuals2DManager.GetSkinKeyHash(arrayPos, noteType, specialType, isGhl);

        if (textureInSkinCache.TryGetValue(hash, out isInSkin))
        {
            return(isInSkin);
        }
        else
        {
            string   noteKey = NoteVisuals2DManager.GetSkinKey(arrayPos, noteType, specialType, isGhl);
            Sprite[] sprites = SkinManager.Instance.currentSkin.GetSprites(noteKey);

            isInSkin = sprites != null && sprites.Length > 0;
            textureInSkinCache[hash] = isInSkin;

            return(isInSkin);
        }
    }
Beispiel #3
0
    bool CheckTextureInSkin()
    {
        Texture2D textureInSkin = null;
        Skin      customSkin    = SkinManager.Instance.currentSkin;

        Note note = nCon.note;

        Note.NoteType    noteType    = note.type;
        Note.SpecialType specialType = NoteVisualsManager.IsStarpower(note);

        int arrayPos = GetSpriteArrayPos(note);

        if (Globals.ghLiveMode)
        {
            if (noteType == Note.NoteType.Strum)
            {
                if (specialType == Note.SpecialType.StarPower)
                {
                    textureInSkin = customSkin.sp_strum_ghl[arrayPos];
                }
                else
                {
                    textureInSkin = customSkin.reg_strum_ghl[arrayPos];
                }
            }
            else if (noteType == Note.NoteType.Hopo)
            {
                if (specialType == Note.SpecialType.StarPower)
                {
                    textureInSkin = customSkin.sp_hopo_ghl[arrayPos];
                }
                else
                {
                    textureInSkin = customSkin.reg_hopo_ghl[arrayPos];
                }
            }
            // Tap notes
            else
            {
                if (!note.IsOpenNote())
                {
                    if (specialType == Note.SpecialType.StarPower)
                    {
                        textureInSkin = customSkin.sp_tap_ghl[arrayPos];
                    }
                    else
                    {
                        textureInSkin = customSkin.reg_tap_ghl[arrayPos];
                    }
                }
            }
        }
        else
        {
            if (noteType == Note.NoteType.Strum)
            {
                if (specialType == Note.SpecialType.StarPower)
                {
                    textureInSkin = customSkin.sp_strum[arrayPos];
                }
                else
                {
                    textureInSkin = customSkin.reg_strum[arrayPos];
                }
            }
            else if (noteType == Note.NoteType.Hopo)
            {
                if (specialType == Note.SpecialType.StarPower)
                {
                    textureInSkin = customSkin.sp_hopo[arrayPos];
                }
                else
                {
                    textureInSkin = customSkin.reg_hopo[arrayPos];
                }
            }
            // Tap notes
            else
            {
                if (note.guitarFret != Note.GuitarFret.Open)
                {
                    if (specialType == Note.SpecialType.StarPower)
                    {
                        textureInSkin = customSkin.sp_tap[arrayPos];
                    }
                    else
                    {
                        textureInSkin = customSkin.reg_tap[arrayPos];
                    }
                }
            }
        }

        return(textureInSkin);
    }