Exemplo n.º 1
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);
            }
        }