Example #1
0
    public void SetCharacterSelected(Mini characterToSelect, int spriteIndex)
    {
        if (firstTimeClicked)
        {
            characterImage.gameObject.SetActive(true);
            Destroy(capa);
        }

        if (characterSelected != null && characterSelected.characterName != characterToSelect.characterName)
        {
            characterSelected.PlayIdle();
            characterSelected.Reset();
        }

        characterSelected = characterToSelect;

        string dhalsimArtist          = "@taj_tajima";
        string gambitArtist           = "@byulabyu";
        string currentInstagramArtist = characterSelected.artistInstagrams[spriteIndex];

        if (currentInstagramArtist == dhalsimArtist || currentInstagramArtist == gambitArtist)
        {
            if (currentInstagramArtist == dhalsimArtist)
            {
                dhalsim.SetActive(true);
            }
            else
            {
                gambit.SetActive(true);
            }
            characterImage.gameObject.SetActive(false);
        }
        else
        {
            dhalsim.SetActive(false);
            gambit.SetActive(false);
            characterImage.gameObject.SetActive(true);
        }

        characterImage.sprite = characterSelected.sprites[spriteIndex];
        characterName.text    = characterSelected.characterName;
        artistInstagram.text  = currentInstagramArtist;
    }