Exemplo n.º 1
0
 void SelectCard(int index)
 {
     this.index = index;
     for (int i = 0; i < cards.Length; i++)
     {
         cards[i].SetSelect((i + 1) == index);
         Vector3 pos = cards[i].transform.localPosition;
         pos.z = (i + 1) == index ? -1 : 0;
         cards[i].transform.localPosition = pos;
         cards[i].transform.localScale    = (i + 1) == index ? new Vector3(1.2f, 1.2f, 1) : Vector3.one;
     }
     nameSprite.SetName(index);
     SelectCharacter(index);
     lockSprite.SetActive(cards[index - 1].isLock);
 }
Exemplo n.º 2
0
    void SetCharacter(int index, bool press = false)
    {
        DataUtils.characterID = index + 1;
        model.SetIndex(index + 1, press);
        nameSprite.SetName(index);
        for (int i = 0; i < cards.Length; i++)
        {
            cards[i].SetFocus(i == characterIndex);
        }

        if (press)
        {
            selectEff.gameObject.SetActive(true);
            Sounder.instance.Play("选中人物音效");
        }
        else
        {
            Sounder.instance.Play("按键音效");
        }
    }