Exemple #1
0
        internal SymbolHolder[] GetHoldersOnPath()
        {
            if (paths == null)
            {
                return(null);
            }
            List <SymbolHolder> list = new List <SymbolHolder>();

            for (int x = 0; x < slot.reels.Length; x++)
            {
                if (x >= paths.Length)
                {
                    break;
                }
                int  currentRow = paths[x];
                Reel reel       = slot.reels[x];
                if (reel == null)
                {
                    break;
                }
                if (!slot.config.isRowValid(currentRow))
                {
                    break;
                }
                if (slot.rows.Length > currentRow)
                {
                    list.Add(slot.rows[currentRow].holders[x]);
                }
            }
            return(list.ToArray());
        }
Exemple #2
0
        public void ApplySymbolMap(SymbolMap map = null, List <SymbolSwapper> swaps = null)
        {
            for (int x = 0; x < slot.reels.Length; x++)
            {
                Reel reel = slot.reels[x];
                for (int y = 0; y < reel.symbols.Length; y++)
                {
                    Symbol symbol = map == null ? reel.symbols[y] : (x < map.symbols.Count && y < map.symbols[x].Count) ? map.symbols[x][y] : null;
                    if (swaps != null)
                    {
                        for (int i = 0; i < swaps.Count; i++)
                        {
                            if (symbol == swaps[i].from)
                            {
                                symbol = swaps[i].to;
                            }
                        }
                    }
                    reel.symbols[y] = symbol ?? slot.skin.defaultSymbol;
                }
                reel.RefreshHolders();
            }

            if (swaps != null)
            {
                for (int i = 0; i < swaps.Count; i++)
                {
                    if (swaps[i].to)
                    {
                        swaps[i].to.ignoreThisRound = true;
                    }
                }
            }
        }
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            Reel t = target as Reel;

            GUILayout.Space(20);
            if (GUILayout.Button("Refresh Reel"))
            {
                t.RefreshHolders();
                EditorUtility.SetDirty(t);
            }
        }
Exemple #4
0
 internal SymbolHolder OnRefreshLayout(Reel reel, int index)
 {
     this.reel = reel;
     _rect     = transform as RectTransform;
     y         = -slot.layoutRow.cellSize.y * index;
     _rect.SetParent(reel.transform, false);
     symbolIndex     = slot.config.totalRows - 1 - index;
     _rect.sizeDelta = reel.slot.layout.sizeSymbol;
     if (faceFront)
     {
         transform.eulerAngles = new Vector3(0, 0, 0);
     }
     if (!animator)
     {
         animator = gameObject.AddComponent <Animator>();
     }
     return(this);
 }
Exemple #5
0
 public ReelInfo(Reel reel)
 {
     this.reel = reel;
 }