Пример #1
0
    // Use this for initialization
    void Start()
    {
        Instance      = this;
        m_bobble      = new Bobble[row, col];
        emptyPointPos = GameObject.Find("Empty Point").transform.position;
        topWall       = GameObject.FindWithTag("TopWall");

        // Initiate bobbles
        InitiLayer();

        //  Create bobbles ready to shoot
        Vector3 shotpos = GameObject.FindGameObjectWithTag("Player").transform.position;

        randBobble    = bobbleStyle[Random.Range(0, layerMaxBallNum)];
        m_shotball[0] = Instantiate(randBobble, shotpos, Quaternion.identity) as GameObject;
        shotpos       = GameObject.Find("Point").transform.position;
        randBobble    = bobbleStyle[Random.Range(0, layerMaxBallNum)];
        m_shotball[1] = Instantiate(randBobble, shotpos, Quaternion.identity) as GameObject;
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        Instance      = this;
        m_bobble      = new bobble[row, col];
        emptyPoint    = GameObject.Find("Empty Point");
        emptyPointPos = emptyPoint.transform.position;

        // Initiate bobbles
        Init(Config.initRow);
        //  Create bobbles ready to shoot
        Vector3 shootPos = GameObject.FindGameObjectWithTag("Cannon").transform.position;

        randBobble     = bobbleStyle[Random.Range(0, layerMaxBallNum)];
        shootBobble[0] = Instantiate(randBobble, shootPos, Quaternion.identity) as GameObject;
        shootBobble[0].transform.parent = GameObject.Find("Moving Up").transform;
        Vector3 loadingPos = GameObject.Find("Loading").transform.position;

        randBobble     = bobbleStyle[Random.Range(0, layerMaxBallNum)];
        shootBobble[1] = Instantiate(randBobble, loadingPos, Quaternion.identity) as GameObject;
        shootBobble[1].transform.parent = GameObject.Find("Moving Up").transform;
    }