public void AddFeaturedCell(CellData cd) { if (featuredCells == null) { featuredCells = new List <CellData>(1); } AddCell(featuredCells, cd); if (cd != null && GameObjectsSet.IsEmptyObject(cd.ID)) { if (overlays == null) { overlays = new List <CellData>(1); } AddCell(overlays, cd); } }
public void OpenMainBrushPanel_Click() { Debug.Log("open main brush click"); BubbleGrid grid = GameBoard.Instance.grid; LevelConstructSet lcs = GameBoard.Instance.gcSet.GetLevelConstructSet(BubblesPlayer.CurrentLevel); ScrollPanelController sRC = MainBrushContainer.ScrollPanel; if (sRC) // { sRC.CloseScrollPanel(true, null); } else { CloseOpenedPanels(); //instantiate ScrollRectController sRC = MainBrushContainer.InstantiateScrollPanel(); sRC.textCaption.text = "Main brush panel"; List <BaseObjectData> mData = new List <BaseObjectData>(); mData.Add(lcs.Matchset.Empty); if (lcs.Matchset.MainObjects != null) { foreach (var item in lcs.Matchset.MainObjects) { mData.Add(item); } } //create main bubbles brushes for (int i = 0; i < mData.Count; i++) { BaseObjectData mD = mData[i]; CreateButton(smallButtonPrefab, sRC.scrollContent, mD.ObjectImage, () => { Debug.Log("Click on Button <" + mD.ID + "...> "); mainBrush = (!GameObjectsSet.IsEmptyObject(mD.ID)) ? lcs.Matchset.GetMainObject(mD.ID) : lcs.Matchset.Empty; mainBrushImage.sprite = mainBrush.ObjectImage; SelectMainBrush(); }); } sRC.OpenScrollPanel(null); } }
private void AddCell(List <CellData> list, CellData cd) { if (list.Count > 0) { list.RemoveAll((c) => { return((cd.Column == c.Column) && (cd.Row == c.Row)); }); } if (!GameObjectsSet.IsEmptyObject(cd.ID)) { list.Add(cd); } else { Debug.Log("empty"); } SetAsDirty(); if (list == featuredCells) { Debug.Log(featuredCells.Count); } }
public void OpenOverBrushPanel_Click() { Debug.Log("open over brush click"); ScrollPanelController sRC = OverBrushContainer.ScrollPanel; if (sRC) // { sRC.CloseScrollPanel(true, null); } else { CloseOpenedPanels(); //instantiate ScrollRectController sRC = OverBrushContainer.InstantiateScrollPanel(); sRC.textCaption.text = "Over brush panel"; List <BaseObjectData> mData = new List <BaseObjectData>(); mData.Add(GOSet.Empty); if (GOSet.OverlayObjects != null) { mData.AddRange(GOSet.OverlayObjects.GetBaseList()); } //create over brushes for (int i = 0; i < mData.Count; i++) { BaseObjectData mD = mData[i]; CreateButton(smallButtonPrefab, sRC.scrollContent, mD.ObjectImage, () => { Debug.Log("Click on Button <" + mD.ID + "...> "); overBrush = (!GameObjectsSet.IsEmptyObject(mD.ID)) ? GOSet.GetOverlayObject(mD.ID) : GOSet.Empty; overBrushImage.sprite = overBrush.ObjectImage; SelectOverBrush(); }); } sRC.OpenScrollPanel(null); } }