Example #1
0
        public void SymbolShiftDown(int addedValue)
        {
            SpinCount++;

            if (bWildFCExist && (SymbolFC == null) && (StopOffset == -1))
            {
                Symbol symbolFC = game.GetSymbolByType(SymbolType.WildFC);
                if (symbolFC != null)
                {
                    float yOffset = game.SymbolSizePlusMargin * (float)(game.RowCount - 1) * 0.5f;

                    GameObject go = BEObjectPool.Spawn(symbolFC.prfab);
                    go.transform.SetParent(tr);
                    go.transform.localScale    = Vector3.one;
                    go.transform.localPosition = SymbolPos[3] + new Vector3(0, yOffset, 0);
                    SymbolFC = go;
                    //Debug.Log ("SymbolFC Created Pos:"+SymbolPos[3]);
                }
                else
                {
                    Debug.Log("No Wild-FullColumn found!!!");
                }
            }

            if ((SymbolFC != null) && (SpinCount == game.RowCount))
            {
                BEObjectPool.Unspawn(SymbolFC);
                SymbolFC = null;
            }

            for (int y = 0; y < game.RowCount + 1; ++y)
            {
                if (y == 0)
                {
                    BEObjectPool.Unspawn(Symbols[0]);
                    //Destroy(Symbols[0]);
                }

                if (y == game.RowCount)
                {
                    Symbols[y] = null;
                    SetSymbol(y, addedValue);
                }
                else
                {
                    Symbols[y] = Symbols[y + 1];
                }

                Symbols[y].transform.localPosition = SymbolPos[y];
                Symbols[y].name = "Symbol" + y.ToString();
            }

            if (SymbolFC != null)
            {
                SymbolFC.transform.SetAsLastSibling();
            }
        }
Example #2
0
        // add healthbar ui
        public GameObject AddInGameUI(GameObject prefab, Transform trObject, Vector3 vOffset)
        {
            InGameUI newDU = new InGameUI();

            newDU.trObject = trObject;
            newDU.vOffset  = vOffset;
            newDU.trUI     = BEObjectPool.Spawn(prefab, InGameUIRoot, new Vector3(1000, 1000, 1000), Quaternion.identity).transform;
            newDU.depth    = 0;
            InGameUIs.Add(newDU);
            newDU.trUI.localScale = new Vector3(1, 1, 1);

            return(newDU.trUI.gameObject);
        }
Example #3
0
        public void Init(SlotGame script, int x)
        {
            tr   = transform;
            game = script;            //tr.parent.GetComponent<SlotGame>();
            ID   = x;

            Symbols     = new GameObject[game.RowCount + 1];
            SymbolPos   = new Vector3[game.RowCount + 1];
            FinalValues = new int[game.RowCount];
            for (int y = 0; y < game.RowCount + 1; ++y)
            {
                GameObject go = BEObjectPool.Spawn(game.Symbols[0].prfab);
                go.transform.SetParent(tr);
                go.transform.localPosition = Vector3.zero;
                go.transform.localScale    = Vector3.one;
                go.name    = "Symbol" + y.ToString();
                Symbols[y] = go;
            }
        }
Example #4
0
        public void SetSymbol(int y, int Value)
        {
            if (Symbols[y] != null)
            {
                BEObjectPool.Unspawn(Symbols[y]);
            }

            //Debug.Log ("SetSymbol y:"+y+" Value:"+Value);
            Symbol newSymbol = game.GetSymbol(Value);

            //Debug.Log ("newSymbol "+newSymbol);
            if (newSymbol.type == SymbolType.WildFC)
            {
                newSymbol = game.GetSymbolByType(SymbolType.Wild);
            }

            GameObject go = BEObjectPool.Spawn(newSymbol.prfab);

            //Debug.Log ("go "+go);
            go.transform.SetParent(tr);
            go.transform.localScale    = Vector3.one;
            go.transform.localPosition = SymbolPos[y];
            Symbols[y] = go;
        }