Ejemplo n.º 1
0
    void OnLoadSongComplete(SongClient client, Song song)
    {
        GuanKaItem item = null;

        foreach (var gkItem in m_guanKaItemCache)
        {
            if (gkItem.guanKa.song.id == song.id)
            {
                item = gkItem;
                break;
            }
        }
        if (item != null)
        {
            item.image.color         = m_NormalColor;
            item.image.raycastTarget = true;
        }
    }
Ejemplo n.º 2
0
    void IntiData()
    {
        Debug.Log("guankaMenuView IntiData");

        m_guanKaItems    = GuanKaLogic.Instance.GetGuanKaList().ToArray();
        m_guanKaCount    = m_guanKaItems.Length;
        m_guanKaMaxWidth = (m_guanKaCount > 0 ? m_guanKaCount - 1 : 0) * m_guanKaItemWidth;

        if (m_guanKaCount > 0)
        {
            m_guanKaItemCache.Clear();
            foreach (var guanKa in m_guanKaItems)
            {
                GameObject gkObj = GameObject.Instantiate(m_GuanKaListItem);
                gkObj.Attach(m_GuanKaListScrollRect.content.gameObject);
                gkObj.SetActive(true);
                gkObj.name = guanKa.id.ToString();

                Image image = gkObj.transform.Find("image").GetComponent <Image>();
                image.color         = m_DisableColor;
                image.raycastTarget = false;
                UIEventManager.Instance.AddOnClickHandler(image.gameObject, OnClickGuanKaItem);
                Text nameText = gkObj.transform.Find("name").GetComponent <Text>();

                GuanKaItem item = new GuanKaItem();
                item.guanKa   = guanKa;
                item.image    = image;
                item.nameText = nameText;
                item.obj      = gkObj;
                m_guanKaItemCache.Add(item);

                nameText.text = guanKa.name;
            }
        }

        LoadSong();

        ChangeGuanKaObjNavi();
        m_CurrentGuanKaObj.SetAsDefaultNavi();
    }