private void InitComponent(out Canvas canvas) { _rect = GetComponent <RectTransform>(); canvas = null; foreach (Canvas c in _rect.GetComponentsInParent <Canvas>()) { if (c.isRootCanvas) { canvas = c; break; } } _clippingMask = _rect.Find("ClippingMask").GetComponent <RectTransform>(); _rightPage = _rect.Find("RightPage").gameObject.AddComponent <Page>(); _leftPage = _rect.Find("LeftPage").gameObject.AddComponent <Page>(); _leftSideOfPage = _rect.Find("LeftSide").gameObject.AddComponent <TheDraggingPage>(); _rightSideOfPage = _rect.Find("RightSide").gameObject.AddComponent <TheDraggingPage>(); _rect.Find("RightDragButton").gameObject .AddComponent <DragButton>() .Init(OnMouseDragRightPage, OnUpdateDage, OnEndDragRightPage); _rect.Find("LeftDragButton").gameObject .AddComponent <DragButton>() .Init(OnMouseDragLeftPage, OnUpdateDage, OnEndDragLeftPage); _rightPage.Init(GetSprite); _leftPage.Init(GetSprite); _leftSideOfPage.Init(GetSprite); _rightSideOfPage.Init(GetSprite); }
public DragRightPage(UIBook book, BookModel model, TheDraggingPage frontPage, TheDraggingPage backPage, Vector3 startPos) : base(book, model, frontPage, backPage, startPos) { }
public DragPageBase(UIBook book, BookModel model, TheDraggingPage frontPage, TheDraggingPage backPage, Vector3 startPos) { _book = book; _bookModel = model; _frontPage = frontPage; _backPage = backPage; _startPos = startPos; _clippingMask = book.GetClippingMask(); }