Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 MOJAJA · Aug 30, 2019 at 09:48 AM · gamepreviewsetupquiz

How to make review system in quiz game?

Hi all ,I want to make a review system in my quiz game.

The player can review the questions on every Level before playing.

I want to show 10 questions each round.

But it will show Round 1-1,Round 2-2, Round 3-3...to Round 10-10 , total ten questions.

This is not what I want. I want Round 1 , 1-10 questions.

Can someone check my code and give me a point.

Thank !

RoundData:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 
 [System.Serializable]
 public class RoundData 
 {
 
     public string _name;
     public float timeLimitInSeconds  ;
     public QueData[] questions;
     
    
 }


QueData:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 
 [System.Serializable]
 public class QueData 
 {
    
     public string queText;
     public AnsData[] answers;
 
 }
 



QueButton:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 
 public class QueButton : MonoBehaviour
 {
     public Text queText;
     private QueData queData;
 
 
     public void QueSetup(QueData data)
     {
         queData = data;
         queText.text = queData.queText;
     }
 
 
 }
 


QuizCon:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using System.IO;
 using UnityEngine.Networking;
 using System.Text;
 
 
 
 
 public class QuizCon : MonoBehaviour
 {
     public RoundData[] allRoundData;
     public Transform queButtonParent;
     public SimpleObjectPool queButtonObjectPool;
 
     private int index;
     private string gameDataFileName = "quiz.json";
 
 
 
 
     private void Start()
     {
         //index = PlayerPrefs.GetInt("NowLevelStage");
         DontDestroyOnLoad(gameObject);
         StartCoroutine(testload());
         ShowQue();
     }
 
     public RoundData GetCurrectRoundData()
     {
         return allRoundData[index];
     }
 
     public void RoundAdd(int LevelNum)
     {
         index = LevelNum;
     }
 
     private void ShowQue()
     {
         for (int i = 0; i < allRoundData.Length; i++)
         {
 
             RoundData round = allRoundData[i];
 
             GameObject queButtonObject = queButtonObjectPool.GetObject();
             queButtonObject.transform.SetParent(queButtonParent);
 
             QueButton queButton = queButtonObject.GetComponent<QueButton>();
             queButton.QueSetup(round.questions[i]);
         }
     }
 

Like this alt text

01.png (10.3 kB)
Comment
Add comment · Show 2
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 xxmariofer · Sep 02, 2019 at 06:22 AM 0
Share

you need to tell us why is not working and whats happening

avatar image MOJAJA xxmariofer · Sep 02, 2019 at 07:47 AM 0
Share

sorry , I didn't say it clearly. I will update my information ,and try my best to explain the situation.

1 Reply

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

Answer by xxmariofer · Sep 02, 2019 at 08:56 AM

      private void ShowQue()
      {
          RoundData round = allRoundData[index];
          for (int i = 0; i < round.Questions.Lenght; i++)
          {
              GameObject queButtonObject = queButtonObjectPool.GetObject();
              queButtonObject.transform.SetParent(queButtonParent);
  
              QueButton queButton = queButtonObject.GetComponent<QueButton>();
              queButton.QueSetup(round.questions[i]);
          }
      }
Comment
Add comment · Show 1 · 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 MOJAJA · Sep 02, 2019 at 10:22 AM 0
Share

Thank you a lot,it's work now .

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

145 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 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 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 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 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 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 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 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

Quiz game with images 0 Answers

Question about game setup 0 Answers

Creating a Multiple Choice Game 2 Answers

Code to integrate Json database? 2 Answers

Make quiz game Confused About PlayerPrefs and database 1 Answer


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