Пример #1
0
    public Sprite getQSprite(Const.AnimalType pAt, int pId)
    {
        DebugLogger.Log(pAt + " " + pId);
        Sprite sp = spritesList [(int)pAt] [pId - 1];

        return(sp);
    }
Пример #2
0
    Sprite getSprite(Const.AnimalType pAt, int pNumber)
    {
        string path = FOLDER_PATH [(int)pAt] + pNumber.ToString();
        Sprite sp   = Resources.Load <Sprite>(path);

        return(sp);
    }
Пример #3
0
 string getAnimalName(Const.AnimalType pAnimal)
 {
     if (pAnimal == Const.AnimalType.FROG)
     {
         return(Const.FROG);
     }
     if (pAnimal == Const.AnimalType.RABBIT)
     {
         return(Const.RABBIT);
     }
     return(Const.OTHERS);
 }
Пример #4
0
    string getImagePath(Const.AnimalType pAt)
    {
        string path = "";
        int    imagesCounterIndex = (int)pAt;

        path  = FOLDER_PATH [imagesCounterIndex];
        path += images_counter_array [imagesCounterIndex].ToString();

        // max越えたら1に戻す
        images_counter_array [imagesCounterIndex]++;
        if (images_counter_array [imagesCounterIndex] > images_max_count [imagesCounterIndex])
        {
            images_counter_array [imagesCounterIndex] = 1;
        }

        return(path);
    }
Пример #5
0
    void createCard(int pId, Const.AnimalType pAt, Sprite pSprite, Vector3 pPosition, bool pIsUnlocked = true)
    {
        GameObject go = (GameObject)Instantiate(_cardPrefab, _cardPrefab.transform.position, _cardPrefab.transform.rotation);

        go.transform.SetParent(_cardList.transform);
        go.transform.localPosition = pPosition;
        go.name = "CARD_" + pId.ToString("D2");

        Card card = go.GetComponent <Card> ();

        card.id       = pId;
        card.at       = pAt;
        card.mySprite = pSprite;

        go.GetComponent <Image> ().sprite = (pIsUnlocked) ? card.mySprite : card._defaultSprite;

        _cards.Add(card);
    }
Пример #6
0
    // 蛙 : Position.Leftなら1、Rightなら0
    // 兎 : Position.Leftなら0、Rightなら1
    // 他 : 2

    // Answer
    // 0 : 左タップ
    // 1 : 右タップ
    // 2 : スワイプ
    public int getAnswer()
    {
        Question q = questionList [counter];

        Const.AnimalType at = q.questionImage.animalType;
        DebugLogger.Log("Position:" + q.position + " at:" + at);


        if (at == Const.AnimalType.OTHERS)
        {
            return(0);
        }
        if (at == Const.AnimalType.FROG)
        {
            if (q.position == Const.Position.LEFT)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
        else if (at == Const.AnimalType.RABBIT)
        {
            if (q.position == Const.Position.LEFT)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
        return(-1);
    }