Exemple #1
0
    public void UpdateDrag()
    {
        _bookModel.ClickPoint = _book.GetClickPos();

        _backPage.SetParent(_clippingMask, true);
        _frontPage.SetParent(_book.transform, true);

        _bookModel.CurrentPageCorner = _book.CulculateDraggingCorner(_bookModel.ClickPoint);

        Vector3 bottomCrossPoint = UpdateClippingMask();

        UpdateBackSide(bottomCrossPoint);

        _frontPage.SetParent(_clippingMask, true);
        _frontPage.ResetShadowData();
        _frontPage.transform.SetAsFirstSibling();

        _backPage.SetShadowFollow(_clippingMask);
    }
Exemple #2
0
    /// <summary>
    /// 拖拽中
    /// </summary>
    public void DraggingPage()
    {
        _model.ClickPoint = _book.GetClickPos();

        _backPage.SetParent(_clippingMask, true);
        _frontPage.SetParent(_book.transform, true);

        _model.CurrentPageCorner = _book.CalculateDraggingCorner(_model.ClickPoint);

        Vector3 bottomCrossPoint = UpdateClippingMask();

        UpdateBackSide(bottomCrossPoint);

        //在其他东西都准备好后将拖拽页前面设置到_clippingMask下并将其设为第一项
        _frontPage.SetParent(_clippingMask, true);
        _frontPage.ResetShadowData();
        _frontPage.transform.SetAsFirstSibling();

        //使阴影跟随clippingMask
        _backPage.SetShadowFollow(_clippingMask);
    }