public void TurnBookCover() { bookCrontrol.Open_Book(); bookOpen = true; StartCoroutine(SparayLeaves()); group.gameObject.SetActive(true); group2.gameObject.SetActive(true); }
void OnGUI() { if (bookControl == null) return; // we don't have the book set. // is the book open ? if (!bookControl.IsOpen()) { if (GUI.Button(new Rect(0, 5, 164, 90), "Open")) { // Open the book bookControl.Open_Book(); } } else { if (GUI.Button(new Rect(0, 50, 164, 90), "Close")) { // Close the book bookControl.Close_Book(); } // Check to see if we can turn the page if (bookControl.CanTurnPage()) { if (GUI.Button(new Rect(0, 200, 164, 90), "Turn page")) { // Turn the page bookControl.Turn_Page(); } } // Check to see if we can turn back the page. if (bookControl.CanGoBackAPage()) { // Turn back the page. if (GUI.Button(new Rect(0, 300, 164, 90), "Turn page back")) { bookControl.Turn_BackPage(); } } } }
// Update is called once per frame void Update() { if (_BookTriggered) { return; } RaycastHit raycastHit; if (Physics.Raycast(new Ray(m_Camera.transform.position, m_Camera.transform.forward), out raycastHit, 5, m_BookLayer)) { m_OpenBook.Open_Book(); m_Particles.SetActive(true); _BookTriggered = true; m_Particles.transform.DOMove(m_Camera.transform.position, m_MoveDuration).SetDelay(m_MoveDelay); m_Particles.transform.DOScale(m_FinalParticleSize, m_MoveDuration).SetDelay(m_MoveDelay).OnComplete(delegate { // m_Fader.FadeOut(OnCompletedMove); }); } }
public void TurnBookCover() { bookCrontrol.Open_Book(); bookOpen = true; StartCoroutine(SparayLeaves()); }
private void SwipeDetector_OnSwipe(SwipeData data) { Debug.Log("Swipe in Direction: " + data.Direction); if (data.Direction == SwipeDirection.Up) { Timeline.SetActive(true); StartCoroutine(TimelineDeactivator()); } if (bookControl == null) return; // we don't have the book set. // is the book open ? if (!bookControl.IsOpen()) { if (data.Direction == SwipeDirection.Left && activePage == 0) { // Open the book bookControl.Open_Book(); activePage =1; Debug.Log(activePage); } } else { if (data.Direction == SwipeDirection.Right && activePage == 1) { // Close the book bookControl.Close_Book(); activePage--; Debug.Log(activePage); } // Check to see if we can turn the page if (bookControl.CanTurnPage()) { if (data.Direction == SwipeDirection.Left && activePage <4) { // Turn the page bookControl.Turn_Page(); activePage++; Debug.Log(activePage); } } // Check to see if we can turn back the page. if (bookControl.CanGoBackAPage()) { // Turn back the page. if (data.Direction == SwipeDirection.Right && activePage > 0) { bookControl.Turn_BackPage(); activePage--; Debug.Log(activePage); } } } }