Esempio n. 1
0
    void RobotAttack(int row, int col, int power)
    {
        GameObject obj      = Instantiate(Resources.Load("Prefabs/bubble") as GameObject);
        Bubble     bubble   = obj.GetComponent <Bubble>();
        Vector3    position = new Vector3(col * GameConst.tileWidth + GameConst.tileWidth / 2,
                                          -row * GameConst.tileHeight - GameConst.tileHeight / 2, transform.position.z);

        bubble.transform.position = position;
        bubble.power    = power;
        bubble.maxPower = maxPower;
        bubble.col      = col;
        bubble.row      = row;
        bubble.time     = boomTime;
        bubble.Player   = this.transform;
        bubble.resetBox();
        bubbles.Add(bubble);
        if (GameConst.bubbles[row, col] != null)
        {
            Debug.Log("ERROR");
        }
        else
        {
            GameConst.bubbles[row, col] = bubble;
            AllPlayerFunctions.SetInBubble(row, col);
        }
    }
Esempio n. 2
0
    public void GlobalAttack(int row, int col)
    {
        GameObject obj      = Instantiate(Resources.Load("Prefabs/bubble") as GameObject);
        Bubble     bubble   = obj.GetComponent <Bubble>();
        Vector3    position = new Vector3(col * GameConst.tileWidth + GameConst.tileWidth / 2,
                                          -row * GameConst.tileHeight - GameConst.tileHeight / 2, transform.position.z + 0.001f);

        bubble.transform.position = position;
        bubble.power    = power;
        bubble.maxPower = maxPower;
        bubble.col      = col;
        bubble.row      = row;
        bubble.time     = boomTime;
        bubble.Player   = this.transform;
        bubble.resetBox();
        GameConst.bubbles[row, col] = bubble;
        AllPlayerFunctions.SetInBubble(row, col);
    }