Exemplo n.º 1
0
    public void Init()
    {
        if (_lock == null)
        {
            _lock = new Object();
        }

        m_level    = GamePlaying.Instance().currentLevel;
        m_resource = ResourceMgr.Instance();

        speed       = 0.005f;
        moveSpeed   = -speed;
        canLink     = true;
        isLoadDone  = false;
        usingPropID = GamePropsId.None;
        isUsingProp = false;
        m_CanTouch  = true;

        boxPanelW = m_level.width * ConstValue.BoxWidth;
        boxPanelH = m_level.height * ConstValue.BoxHeight;
        Debug.Log("boxPanelWH:" + boxPanelW + "," + boxPanelH);

        transform.position = new Vector3(0, ScreenInfo.h / 2 - ConstValue.BoxHeight * visibleRow + boxPanelH / 2, 0);
        background         = Instantiate(m_resource.GetResFromName(ConstValue.GAME_BACKGROUND),
                                         new Vector3(10f, 10f, 0),
                                         Quaternion.identity) as GameObject;
        background.transform.parent = transform;

        boxManager = BoxManager.GetInstance();
        boxManager.Init();

        bottomRow = m_level.height - 1;
        InitBoxs(bottomRow, visibleRow);
        GetBottomBox();
    }