Пример #1
0
    public void SetColorAfterWhot(string color)
    {
        colorinfopanel.SetActive(true);
        colorname.text = WhotConstants.GetColorFolder(color);
        int soundId = -1;

        switch (colorname.text)
        {
        case "Circle":
            soundId = (int)ListOfSounds.Circle;
            break;

        case "Triangle":
            soundId = (int)ListOfSounds.Triangle;
            break;

        case "Crosses":
            soundId = (int)ListOfSounds.Crosses;
            break;

        case "Square":
            soundId = (int)ListOfSounds.Square;
            break;

        case "Star":
            soundId = (int)ListOfSounds.Star;
            break;
        }
        if (soundId != -1)
        {
            SoundManger.instance.PlaySound(soundId);
        }
    }
Пример #2
0
    void ShowImageOnCard(string cardName, bool show)
    {
        string colorKey   = cardName.Substring(0, 3);
        string cardNum    = cardName.Substring(3, cardName.Length - 3);
        string folderName = WhotConstants.GetColorFolder(colorKey);

        cardMaterial.mainTexture = Resources.Load <Texture>("cards/" + folderName + "/" + cardNum);

        if (show)
        {
            card.transform.localRotation = Quaternion.Euler(0, 180f, 0);
        }
        else
        {
            card.transform.localRotation = Quaternion.Euler(0, 0f, 0);
        }
    }