Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Xeong-Hu · Apr 11, 2015 at 04:29 PM · script.

How do i make a Page flip Function(UI)?

Alright idk what I was trying to ask so i'll put more detail here.

What I'm trying to do is make like clicking function that shows the next thing after the next.

Such as if I click an arrow button displaying my first list of selections. It will then show a second list of selections, and so on.

But I'm confused to how to do this. Does it involve the Library Dictionary Thingy?

Well here's the script I tried. And it failed.

 using UnityEngine;
 using System.Collections;
 
 public class ButtonScript : MonoBehaviour {
     public bool Viewing1 = true;
     public bool Viewing2;
     public bool Viewing3;
 
     // Use this for initialization
     public void CSSBoxSwap(){
         if (Viewing1) {
             Viewing1 = false;
             Viewing3 = false;
 
             Viewing2 = true;
             print ("Swapped to 2nd Box");
                 }
         if (Viewing2) {
             Viewing2 = false;
             Viewing1 = false;
 
             Viewing3 = true;
             print ("Swapped to 3rd Box");
 
         }
         if (Viewing3) {
             Viewing3 = false;
             Viewing2 = false;
 
             Viewing1 = true;
             print ("Swapped to 1st Box");
 
         }
     }
     void Start () {
     
     }
     
     // Update is called once per frame
     public void Update () {
 
     }
 }
 
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Digital-Phantom · Apr 11, 2015 at 05:00 PM

A couple of ways come to mind...

First -

Simply make each new list a new scene. Once the player has read the data on the first page(list) they click a button and the next page/scene will be loaded. This is basically what happens on a start screen with play / options / quit buttons.

(Look up Application.LoadLevel for this)

The second(more technical but probably more visually appealing) -

Use photoshop or paint (or anything similar) to make your list. Then import that image into Unity. Now make a plane and add the image of your page onto the plane.

Now make it so when the player clicks the correct button the plane(list) begins to rotate which would make it look like a page is being turned. As this is being done instantiate another plane with your next image/list on it.

Once the first page has turned you can destroy it, leaving the next plane/page there for the player to read. (repeat this for as many pages as you need)

If you add each plane to an empty gameObject and position it slightly to the side you can rotate the empty object which will give a slightly more realistic looking page turn effect.

Really technical version -

Make a page/list using any 3d modelling program. Make your image as described above. Import those into unity. Add your image to the list/page model (do this for each page)

Now use unitys animation function to simulate the turning of each page when a button is pressed.

Hope some(or all) of this was helpful to you.

:)

edit -

check out these too...

https://www.youtube.com/results?search_query=unity+3d+menu

;)

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Xeong-Hu · Apr 11, 2015 at 05:09 PM 0
Share

Ahh ok. I see. Thanks for the tip but I'm sorry I didn't really mean a visually page flipping animation or stuff. Guess what I really mean is changing the object each time I click the same button again and again.

Perhaps maybe something like each time I click the button the number adds up. and for each number loads a different page. But then if I click the button and I'm at Page 10 the Page number restarts to 1. Think that'll work?

avatar image Digital-Phantom · Apr 11, 2015 at 05:25 PM 1
Share

ok, try something like -

 void Update()
     {
         if (Input.Get$$anonymous$$ey("u"))
         {
             var i = Application.loadedLevel;
             Application.LoadLevel(i+1);
         }
 
                 if (Input.Get$$anonymous$$ey("y"))
         {
             var i = Application.loadedLevel;
             Application.LoadLevel(i+1);
         }
 
 
     }
 
 

make each page/list a separate scene and then just move forward of backwards through the scenes

avatar image Xeong-Hu · Apr 11, 2015 at 05:36 PM 1
Share

Perfect Dude! Thanks! And don't worry I won't take your info above for granted. The more i know the better. Thanks again!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make horror nps with audisource? (plzs cript) 0 Answers

how to refrence script through public transform 1 Answer

OverlapBoxNonAlloc not working correctly when called multiple times in single frame 1 Answer

cannot create scripts as components or add existing script 0 Answers

Help building a script to alter parameters of glitch effect in URP,Script to alter parameters for camera glitch effect 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges