Esempio n. 1
0
    public void Set(UnitAlbumPanel parentPanel, AlbumController.EAlbumType albumType)
    {
        _parentPanel = parentPanel;
        _type        = albumType;

        Text.text = AlbumController.GetAlbumTypeName(_type);

        onEnable();
    }
Esempio n. 2
0
    //
    public void Set(Sprite s, AlbumController.EAlbumType albumType, bool isLocked)
    {
        set(s);

        _albumType = albumType;

        if (false == isLocked)
        {
            unlock();
        }
    }
Esempio n. 3
0
    private CGScrollView getCGScrollView(AlbumController.EAlbumType albumType)
    {
        int count = _cgScrollViewList.Count;

        for (int i = 0; i < count; ++i)
        {
            if (_cgScrollViewList[i].AlbumType == albumType)
            {
                return(_cgScrollViewList[i]);
            }
        }

        return(null);
    }
Esempio n. 4
0
    //
    public void ShowCGList(AlbumController.EAlbumType albumType)
    {
        hideAllCGScrollView();

        CGScrollView scrollView = getCGScrollView(albumType);

        if (null == scrollView)
        {
            Log.Error(string.Format("not found CGScrollView; {0}", albumType));
            return;
        }

        scrollView.Show();
    }
Esempio n. 5
0
    private void addAlbumType(AlbumController.EAlbumType albumType)
    {
        CGScrollView scrollView = Instantiate(PrefCGScrollView);

        scrollView.transform.SetParent(CGScrollViewListPanel.transform, false);
        scrollView.Set(AlbumId, albumType);
        scrollView.Hide();

        _cgScrollViewList.Add(scrollView);

        AlbumTypeToggle toggle = Instantiate(PrefAlbumTypeToggle);

        toggle.transform.SetParent(ToggleGroup.transform, false);
        toggle.Set(ToggleGroup);
        toggle.Set(this, albumType);
    }
Esempio n. 6
0
    // @note : called before Start(), after OnEnabled()
    public void Set(int albumId, AlbumController.EAlbumType albumType)
    {
        if (false == AlbumController.IsValid(albumId))
        {
            Log.Error(string.Format("invalid album id; {0}", albumId));
            return;
        }

        if (AlbumController.EAlbumType.MAX == albumType)
        {
            Log.Error("invalid album type");
            return;
        }

        AlbumId   = albumId;
        AlbumType = albumType;

        _buttonCount = createButtons();
    }