diff --git a/Assets/Datasets.meta b/Assets/Datasets.meta deleted file mode 100644 index 042230a..0000000 --- a/Assets/Datasets.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 07d1a25cac254798a4145b98a7c7bde9 -timeCreated: 1768421207 \ No newline at end of file diff --git a/Assets/Datasets/Trivia.json b/Assets/Datasets/Trivia.json deleted file mode 100644 index ea387c1..0000000 --- a/Assets/Datasets/Trivia.json +++ /dev/null @@ -1,952 +0,0 @@ -[ - { - "question" : "2 + 2?", - "choices" : [ - "3", - "4", - "5", - "6" - ], - "answer" : "4" - }, - { - "question" : "What is the capital of France?", - "choices" : [ - "Paris", - "Rome", - "Berlin", - "Madrid" - ], - "answer" : "Paris" - }, - { - "question" : "What color is the sky?", - "choices" : [ - "Blue", - "Green", - "Red", - "Yellow" - ], - "answer" : "Blue" - }, - { - "question" : "What color is grass?", - "choices" : [ - "Green", - "Blue", - "Red", - "White" - ], - "answer" : "Green" - }, - { - "question" : "What is the opposite of hot?", - "choices" : [ - "Cold", - "Warm", - "Dry", - "Wet" - ], - "answer" : "Cold" - }, - { - "question" : "Which direction does the sun rise?", - "choices" : [ - "East", - "West", - "North", - "South" - ], - "answer" : "East" - }, - { - "question" : "How many days are there in a week?", - "choices" : [ - "5", - "6", - "7", - "8" - ], - "answer" : "7" - }, - { - "question" : "How many hours are there in a day?", - "choices" : [ - "12", - "18", - "24", - "36" - ], - "answer" : "24" - }, - { - "question" : "How many letters are in the alphabet?", - "choices" : [ - "24", - "25", - "26", - "27" - ], - "answer" : "26" - }, - { - "question" : "Earth is a?", - "choices" : [ - "Star", - "Planet", - "Moon", - "Comet" - ], - "answer" : "Planet" - }, - { - "question" : "What is the largest planet in the solar system?", - "choices" : [ - "Earth", - "Mars", - "Jupiter", - "Venus" - ], - "answer" : "Jupiter" - }, - { - "question" : "Which number is the smallest?", - "choices" : [ - "1", - "-5", - "10", - "-100" - ], - "answer" : "-100" - }, - { - "question" : "What is the opposite of up?", - "choices" : [ - "Down", - "Left", - "Right", - "Around" - ], - "answer" : "Down" - }, - { - "question" : "What temperature does water freeze at?", - "choices" : [ - "0°C", - "50°C", - "100°C", - "10°C" - ], - "answer" : "0°C" - }, - { - "question" : "What is the fastest land animal?", - "choices" : [ - "Dog", - "Horse", - "Cheetah", - "Cat" - ], - "answer" : "Cheetah" - }, - { - "question" : "What do humans breathe?", - "choices" : [ - "Oxygen", - "Carbon", - "Helium", - "Smoke" - ], - "answer" : "Oxygen" - }, - { - "question" : "What shape has 3 sides?", - "choices" : [ - "Square", - "Triangle", - "Circle", - "Oval" - ], - "answer" : "Triangle" - }, - { - "question" : "What shape has 4 sides?", - "choices" : [ - "Triangle", - "Square", - "Circle", - "Star" - ], - "answer" : "Square" - }, - { - "question" : "Which of these is a Primary color?", - "choices" : [ - "Blue", - "Pink", - "Brown", - "Gray" - ], - "answer" : "Blue" - }, - { - "question" : "What is the opposite of big?", - "choices" : [ - "Small", - "Tall", - "Wide", - "Long" - ], - "answer" : "Small" - }, - { - "question" : "Fire is?", - "choices" : [ - "Hot", - "Cold", - "Wet", - "Soft" - ], - "answer" : "Hot" - }, - { - "question" : "Ice is?", - "choices" : [ - "Cold", - "Hot", - "Dry", - "Hard" - ], - "answer" : "Cold" - }, - { - "question" : "Which day is after Monday?", - "choices" : [ - "Tuesday", - "Sunday", - "Friday", - "Saturday" - ], - "answer" : "Tuesday" - }, - { - "question" : "Which of these days are on a weekend?", - "choices" : [ - "Monday", - "Tuesday", - "Saturday", - "Wednesday" - ], - "answer" : "Saturday" - }, - { - "question" : "What is the color of a banana?", - "choices" : [ - "Yellow", - "Blue", - "Red", - "Purple" - ], - "answer" : "Yellow" - }, - { - "question" : "What is the color of an apple?", - "choices" : [ - "Red", - "Blue", - "Black", - "Pink" - ], - "answer" : "Red" - }, - { - "question" : "Where do Fish live?", - "choices" : [ - "Water", - "Air", - "Sand", - "Fire" - ], - "answer" : "Water" - }, - { - "question" : "What is the opposite of fast?", - "choices" : [ - "Slow", - "Quick", - "Sharp", - "Bright" - ], - "answer" : "Slow" - }, - { - "question" : "What is the sun?", - "choices" : [ - "Star", - "Planet", - "Moon", - "Rock" - ], - "answer" : "Star" - }, - { - "question" : "What does the moon orbit?", - "choices" : [ - "Earth", - "Sun", - "Mars", - "Jupiter" - ], - "answer" : "Earth" - }, - { - "question" : "How many legs does a human have?", - "choices" : [ - "2", - "4", - "6", - "8" - ], - "answer" : "2" - }, - { - "question" : "How many eyes does a human have?", - "choices" : [ - "1", - "2", - "3", - "4" - ], - "answer" : "2" - }, - { - "question" : "Snow color is snow?", - "choices" : [ - "White", - "Black", - "Red", - "Green" - ], - "answer" : "White" - }, - { - "question" : "What is the opposite of open?", - "choices" : [ - "Closed", - "Wide", - "Large", - "Empty" - ], - "answer" : "Closed" - }, - { - "question" : "What color is milk?", - "choices" : [ - "White", - "Blue", - "Brown", - "Yellow" - ], - "answer" : "White" - }, - { - "question" : "What does fire need to stay alight?", - "choices" : [ - "Oxygen", - "Water", - "Ice", - "Sand" - ], - "answer" : "Oxygen" - }, - { - "question" : "What is the opposite of full?", - "choices" : [ - "Empty", - "Large", - "Wide", - "Heavy" - ], - "answer" : "Empty" - }, - { - "question" : "What color is the sky during the day?", - "choices" : [ - "Blue", - "Black", - "Green", - "Gray" - ], - "answer" : "Blue" - }, - { - "question" : "What color is the sky during the night?", - "choices" : [ - "Black", - "Blue", - "Green", - "Red" - ], - "answer" : "Black" - }, - { - "question" : "2 + 3 =", - "choices" : [ - "4", - "5", - "6", - "7" - ], - "answer" : "5" - }, - { - "question" : "5 - 2 =", - "choices" : [ - "2", - "3", - "4", - "5" - ], - "answer" : "3" - }, - { - "question" : "10 / 2 =", - "choices" : [ - "2", - "4", - "5", - "10" - ], - "answer" : "5" - }, - { - "question" : "3 × 3 =", - "choices" : [ - "6", - "8", - "9", - "12" - ], - "answer" : "9" - }, - { - "question" : "What is the opposite of left?", - "choices" : [ - "Right", - "Up", - "Down", - "Back" - ], - "answer" : "Right" - }, - { - "question" : "What is the color of the sun?", - "choices" : [ - "Yellow", - "Blue", - "Green", - "Purple" - ], - "answer" : "Yellow" - }, - { - "question" : "What do fish breathe through?", - "choices" : [ - "Gills", - "Lungs", - "Skin", - "Fire" - ], - "answer" : "Gills" - }, - { - "question" : "What is the opposite of loud?", - "choices" : [ - "Quiet", - "Fast", - "Sharp", - "Bright" - ], - "answer" : "Quiet" - }, - { - "question" : "What is the color of fire?", - "choices" : [ - "Red", - "Blue", - "Green", - "White" - ], - "answer" : "Red" - }, - { - "question" : "What is the capital of Italy?", - "choices" : [ - "Rome", - "Paris", - "Berlin", - "Madrid" - ], - "answer" : "Rome" - }, - { - "question" : "What is the largest ocean?", - "choices" : [ - "Pacific", - "Atlantic", - "Indian", - "Arctic" - ], - "answer" : "Pacific" - }, - { - "question" : "What is the color of a firetruck?", - "choices" : [ - "Red", - "Blue", - "Green", - "Yellow" - ], - "answer" : "Red" - }, - { - "question" : "What is the color of a banana?", - "choices" : [ - "Yellow", - "Red", - "Blue", - "Purple" - ], - "answer" : "Yellow" - }, - { - "question" : "What planet is known for its rings?", - "choices" : [ - "Saturn", - "Mars", - "Earth", - "Venus" - ], - "answer" : "Saturn" - }, - { - "question" : "What is the largest land animal?", - "choices" : [ - "Elephant", - "Lion", - "Horse", - "Bear" - ], - "answer" : "Elephant" - }, - { - "question" : "What is the tallest tree type?", - "choices" : [ - "Redwood", - "Pine", - "Oak", - "Birch" - ], - "answer" : "Redwood" - }, - { - "question" : "Which celestial body does the Earth rotate around?", - "choices" : [ - "Sun", - "Moon", - "Mars", - "Jupiter" - ], - "answer" : "Sun" - }, - { - "question" : "Which celestial body does the moon orbit?", - "choices" : [ - "Earth", - "Sun", - "Mars", - "Venus" - ], - "answer" : "Earth" - }, - { - "question" : "What is the largest desert?", - "choices" : [ - "Sahara", - "Gobi", - "Kalahari", - "Arctic" - ], - "answer" : "Sahara" - }, - { - "question" : "What is the smallest continent?", - "choices" : [ - "Australia", - "Europe", - "Asia", - "Africa" - ], - "answer" : "Australia" - }, - { - "question" : "What is the largest continent?", - "choices" : [ - "Asia", - "Africa", - "Europe", - "Antarctica" - ], - "answer" : "Asia" - }, - { - "question" : "What planet is closest to the Sun?", - "choices" : [ - "Mercury", - "Venus", - "Earth", - "Mars" - ], - "answer" : "Mercury" - }, - { - "question" : "What planet is farthest from the Sun?", - "choices" : [ - "Neptune", - "Mars", - "Earth", - "Venus" - ], - "answer" : "Neptune" - }, - { - "question" : "What bird cannot fly?", - "choices" : [ - "Ostrich", - "Eagle", - "Sparrow", - "Parrot" - ], - "answer" : "Ostrich" - }, - { - "question" : "Which mammal can fly?", - "choices" : [ - "Bat", - "Cat", - "Dog", - "Horse" - ], - "answer" : "Bat" - }, - { - "question" : "What animal has a trunk?", - "choices" : [ - "Elephant", - "Rhino", - "Horse", - "Lion" - ], - "answer" : "Elephant" - }, - { - "question" : "What animal has stripes?", - "choices" : [ - "Tiger", - "Lion", - "Bear", - "Elephant" - ], - "answer" : "Tiger" - }, - { - "question" : "What animal lays eggs?", - "choices" : [ - "Chicken", - "Dog", - "Cat", - "Cow" - ], - "answer" : "Chicken" - }, - { - "question" : "Largest planet in solar system?", - "choices" : [ - "Jupiter", - "Mars", - "Earth", - "Venus" - ], - "answer" : "Jupiter" - }, - { - "question" : "Smallest planet in solar system?", - "choices" : [ - "Mercury", - "Mars", - "Venus", - "Earth" - ], - "answer" : "Mercury" - }, - { - "question" : "What direction is the opposite of up?", - "choices" : [ - "Down", - "Left", - "Right", - "Back" - ], - "answer" : "Down" - }, - { - "question" : "Hot drink from beans?", - "choices" : [ - "Coffee", - "Tea", - "Milk", - "Water" - ], - "answer" : "Coffee" - }, - { - "question" : "What is the day after Sunday?", - "choices" : [ - "Monday", - "Tuesday", - "Saturday", - "Friday" - ], - "answer" : "Monday" - }, - { - "question" : "What is the longest river?", - "choices" : [ - "Nile", - "Amazon", - "Yangtze", - "Mississippi" - ], - "answer" : "Nile" - }, - { - "question" : "What is the highest mountain?", - "choices" : [ - "Everest", - "K2", - "Kangchenjunga", - "Denali" - ], - "answer" : "Everest" - }, - { - "question" : "What is the largest country?", - "choices" : [ - "Russia", - "Canada", - "China", - "USA" - ], - "answer" : "Russia" - }, - { - "question" : "Language spoken in Spain?", - "choices" : [ - "Spanish", - "French", - "German", - "Italian" - ], - "answer" : "Spanish" - }, - { - "question" : "Language spoken in France?", - "choices" : [ - "French", - "Spanish", - "English", - "German" - ], - "answer" : "French" - }, - { - "question" : "Language spoken in Germany?", - "choices" : [ - "German", - "English", - "Spanish", - "Italian" - ], - "answer" : "German" - }, - { - "question" : "Language spoken in Italy?", - "choices" : [ - "Italian", - "French", - "Spanish", - "German" - ], - "answer" : "Italian" - }, - { - "question" : "Hot beverage from leaves?", - "choices" : [ - "Tea", - "Coffee", - "Milk", - "Water" - ], - "answer" : "Tea" - }, - { - "question" : "Round fruit, red or green?", - "choices" : [ - "Apple", - "Banana", - "Orange", - "Grape" - ], - "answer" : "Apple" - }, - { - "question" : "Long yellow fruit?", - "choices" : [ - "Banana", - "Apple", - "Orange", - "Mango" - ], - "answer" : "Banana" - }, - { - "question" : "Orange citrus fruit?", - "choices" : [ - "Orange", - "Apple", - "Banana", - "Pear" - ], - "answer" : "Orange" - }, - { - "question" : "Green citrus fruit?", - "choices" : [ - "Lime", - "Lemon", - "Orange", - "Grapefruit" - ], - "answer" : "Lime" - }, - { - "question" : "Animal that quacks?", - "choices" : [ - "Duck", - "Goose", - "Chicken", - "Turkey" - ], - "answer" : "Duck" - }, - { - "question" : "Animal that oinks?", - "choices" : [ - "Pig", - "Cow", - "Dog", - "Sheep" - ], - "answer" : "Pig" - }, - { - "question" : "Animal that moos?", - "choices" : [ - "Cow", - "Pig", - "Dog", - "Horse" - ], - "answer" : "Cow" - }, - { - "question" : "What animal has a mane?", - "choices" : [ - "Lion", - "Tiger", - "Elephant", - "Horse" - ], - "answer" : "Lion" - }, - { - "question" : "What animal has a hump?", - "choices" : [ - "Camel", - "Horse", - "Elephant", - "Donkey" - ], - "answer" : "Camel" - }, - { - "question" : "What animal can hop?", - "choices" : [ - "Kangaroo", - "Lion", - "Tiger", - "Elephant" - ], - "answer" : "Kangaroo" - }, - { - "question" : "What animal can swim?", - "choices" : [ - "Fish", - "Dog", - "Cat", - "Horse" - ], - "answer" : "Fish" - }, - { - "question" : "Which animal can fly?", - "choices" : [ - "Bird", - "Cat", - "Dog", - "Elephant" - ], - "answer" : "Bird" - }, - { - "question" : "What animal has a shell?", - "choices" : [ - "Turtle", - "Dog", - "Cat", - "Horse" - ], - "answer" : "Turtle" - }, - { - "question" : "What animal has tusks?", - "choices" : [ - "Elephant", - "Lion", - "Horse", - "Tiger" - ], - "answer" : "Elephant" - }, - { - "question" : "Color of coal?", - "choices" : [ - "Black", - "White", - "Red", - "Green" - ], - "answer" : "Black" - } -] diff --git a/Assets/Prefabs/SampleChild.prefab b/Assets/Prefabs/SampleChild.prefab index 010950d..aab1c99 100644 --- a/Assets/Prefabs/SampleChild.prefab +++ b/Assets/Prefabs/SampleChild.prefab @@ -451,6 +451,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: k__BackingField: {fileID: 3009414327569646558} + k__BackingField: {fileID: 25269235060726753} k__BackingField: {fileID: 7011418079103154681} k__BackingField: {fileID: 2035964200443923097} k__BackingField: {fileID: 2038821404454815492} diff --git a/Assets/Resources.meta b/Assets/Resources.meta new file mode 100644 index 0000000..b28aaef --- /dev/null +++ b/Assets/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c55e1cb43dc42f34f97c2ca8aa046411 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Trivia.json b/Assets/Resources/Trivia.json new file mode 100644 index 0000000..90c8c57 --- /dev/null +++ b/Assets/Resources/Trivia.json @@ -0,0 +1,954 @@ +{ + "questions" : [ + { + "question" : "2 + 2?", + "choices" : [ + "3", + "4", + "5", + "6" + ], + "answer" : "4" + }, + { + "question" : "What is the capital of France?", + "choices" : [ + "Paris", + "Rome", + "Berlin", + "Madrid" + ], + "answer" : "Paris" + }, + { + "question" : "What color is the sky?", + "choices" : [ + "Blue", + "Green", + "Red", + "Yellow" + ], + "answer" : "Blue" + }, + { + "question" : "What color is grass?", + "choices" : [ + "Green", + "Blue", + "Red", + "White" + ], + "answer" : "Green" + }, + { + "question" : "What is the opposite of hot?", + "choices" : [ + "Cold", + "Warm", + "Dry", + "Wet" + ], + "answer" : "Cold" + }, + { + "question" : "Which direction does the sun rise?", + "choices" : [ + "East", + "West", + "North", + "South" + ], + "answer" : "East" + }, + { + "question" : "How many days are there in a week?", + "choices" : [ + "5", + "6", + "7", + "8" + ], + "answer" : "7" + }, + { + "question" : "How many hours are there in a day?", + "choices" : [ + "12", + "18", + "24", + "36" + ], + "answer" : "24" + }, + { + "question" : "How many letters are in the alphabet?", + "choices" : [ + "24", + "25", + "26", + "27" + ], + "answer" : "26" + }, + { + "question" : "Earth is a?", + "choices" : [ + "Star", + "Planet", + "Moon", + "Comet" + ], + "answer" : "Planet" + }, + { + "question" : "What is the largest planet in the solar system?", + "choices" : [ + "Earth", + "Mars", + "Jupiter", + "Venus" + ], + "answer" : "Jupiter" + }, + { + "question" : "Which number is the smallest?", + "choices" : [ + "1", + "-5", + "10", + "-100" + ], + "answer" : "-100" + }, + { + "question" : "What is the opposite of up?", + "choices" : [ + "Down", + "Left", + "Right", + "Around" + ], + "answer" : "Down" + }, + { + "question" : "What temperature does water freeze at?", + "choices" : [ + "0°C", + "50°C", + "100°C", + "10°C" + ], + "answer" : "0°C" + }, + { + "question" : "What is the fastest land animal?", + "choices" : [ + "Dog", + "Horse", + "Cheetah", + "Cat" + ], + "answer" : "Cheetah" + }, + { + "question" : "What do humans breathe?", + "choices" : [ + "Oxygen", + "Carbon", + "Helium", + "Smoke" + ], + "answer" : "Oxygen" + }, + { + "question" : "What shape has 3 sides?", + "choices" : [ + "Square", + "Triangle", + "Circle", + "Oval" + ], + "answer" : "Triangle" + }, + { + "question" : "What shape has 4 sides?", + "choices" : [ + "Triangle", + "Square", + "Circle", + "Star" + ], + "answer" : "Square" + }, + { + "question" : "Which of these is a Primary color?", + "choices" : [ + "Blue", + "Pink", + "Brown", + "Gray" + ], + "answer" : "Blue" + }, + { + "question" : "What is the opposite of big?", + "choices" : [ + "Small", + "Tall", + "Wide", + "Long" + ], + "answer" : "Small" + }, + { + "question" : "Fire is?", + "choices" : [ + "Hot", + "Cold", + "Wet", + "Soft" + ], + "answer" : "Hot" + }, + { + "question" : "Ice is?", + "choices" : [ + "Cold", + "Hot", + "Dry", + "Hard" + ], + "answer" : "Cold" + }, + { + "question" : "Which day is after Monday?", + "choices" : [ + "Tuesday", + "Sunday", + "Friday", + "Saturday" + ], + "answer" : "Tuesday" + }, + { + "question" : "Which of these days are on a weekend?", + "choices" : [ + "Monday", + "Tuesday", + "Saturday", + "Wednesday" + ], + "answer" : "Saturday" + }, + { + "question" : "What is the color of a banana?", + "choices" : [ + "Yellow", + "Blue", + "Red", + "Purple" + ], + "answer" : "Yellow" + }, + { + "question" : "What is the color of an apple?", + "choices" : [ + "Red", + "Blue", + "Black", + "Pink" + ], + "answer" : "Red" + }, + { + "question" : "Where do Fish live?", + "choices" : [ + "Water", + "Air", + "Sand", + "Fire" + ], + "answer" : "Water" + }, + { + "question" : "What is the opposite of fast?", + "choices" : [ + "Slow", + "Quick", + "Sharp", + "Bright" + ], + "answer" : "Slow" + }, + { + "question" : "What is the sun?", + "choices" : [ + "Star", + "Planet", + "Moon", + "Rock" + ], + "answer" : "Star" + }, + { + "question" : "What does the moon orbit?", + "choices" : [ + "Earth", + "Sun", + "Mars", + "Jupiter" + ], + "answer" : "Earth" + }, + { + "question" : "How many legs does a human have?", + "choices" : [ + "2", + "4", + "6", + "8" + ], + "answer" : "2" + }, + { + "question" : "How many eyes does a human have?", + "choices" : [ + "1", + "2", + "3", + "4" + ], + "answer" : "2" + }, + { + "question" : "Snow color is snow?", + "choices" : [ + "White", + "Black", + "Red", + "Green" + ], + "answer" : "White" + }, + { + "question" : "What is the opposite of open?", + "choices" : [ + "Closed", + "Wide", + "Large", + "Empty" + ], + "answer" : "Closed" + }, + { + "question" : "What color is milk?", + "choices" : [ + "White", + "Blue", + "Brown", + "Yellow" + ], + "answer" : "White" + }, + { + "question" : "What does fire need to stay alight?", + "choices" : [ + "Oxygen", + "Water", + "Ice", + "Sand" + ], + "answer" : "Oxygen" + }, + { + "question" : "What is the opposite of full?", + "choices" : [ + "Empty", + "Large", + "Wide", + "Heavy" + ], + "answer" : "Empty" + }, + { + "question" : "What color is the sky during the day?", + "choices" : [ + "Blue", + "Black", + "Green", + "Gray" + ], + "answer" : "Blue" + }, + { + "question" : "What color is the sky during the night?", + "choices" : [ + "Black", + "Blue", + "Green", + "Red" + ], + "answer" : "Black" + }, + { + "question" : "2 + 3 =", + "choices" : [ + "4", + "5", + "6", + "7" + ], + "answer" : "5" + }, + { + "question" : "5 - 2 =", + "choices" : [ + "2", + "3", + "4", + "5" + ], + "answer" : "3" + }, + { + "question" : "10 / 2 =", + "choices" : [ + "2", + "4", + "5", + "10" + ], + "answer" : "5" + }, + { + "question" : "3 × 3 =", + "choices" : [ + "6", + "8", + "9", + "12" + ], + "answer" : "9" + }, + { + "question" : "What is the opposite of left?", + "choices" : [ + "Right", + "Up", + "Down", + "Back" + ], + "answer" : "Right" + }, + { + "question" : "What is the color of the sun?", + "choices" : [ + "Yellow", + "Blue", + "Green", + "Purple" + ], + "answer" : "Yellow" + }, + { + "question" : "What do fish breathe through?", + "choices" : [ + "Gills", + "Lungs", + "Skin", + "Fire" + ], + "answer" : "Gills" + }, + { + "question" : "What is the opposite of loud?", + "choices" : [ + "Quiet", + "Fast", + "Sharp", + "Bright" + ], + "answer" : "Quiet" + }, + { + "question" : "What is the color of fire?", + "choices" : [ + "Red", + "Blue", + "Green", + "White" + ], + "answer" : "Red" + }, + { + "question" : "What is the capital of Italy?", + "choices" : [ + "Rome", + "Paris", + "Berlin", + "Madrid" + ], + "answer" : "Rome" + }, + { + "question" : "What is the largest ocean?", + "choices" : [ + "Pacific", + "Atlantic", + "Indian", + "Arctic" + ], + "answer" : "Pacific" + }, + { + "question" : "What is the color of a firetruck?", + "choices" : [ + "Red", + "Blue", + "Green", + "Yellow" + ], + "answer" : "Red" + }, + { + "question" : "What is the color of a banana?", + "choices" : [ + "Yellow", + "Red", + "Blue", + "Purple" + ], + "answer" : "Yellow" + }, + { + "question" : "What planet is known for its rings?", + "choices" : [ + "Saturn", + "Mars", + "Earth", + "Venus" + ], + "answer" : "Saturn" + }, + { + "question" : "What is the largest land animal?", + "choices" : [ + "Elephant", + "Lion", + "Horse", + "Bear" + ], + "answer" : "Elephant" + }, + { + "question" : "What is the tallest tree type?", + "choices" : [ + "Redwood", + "Pine", + "Oak", + "Birch" + ], + "answer" : "Redwood" + }, + { + "question" : "Which celestial body does the Earth rotate around?", + "choices" : [ + "Sun", + "Moon", + "Mars", + "Jupiter" + ], + "answer" : "Sun" + }, + { + "question" : "Which celestial body does the moon orbit?", + "choices" : [ + "Earth", + "Sun", + "Mars", + "Venus" + ], + "answer" : "Earth" + }, + { + "question" : "What is the largest desert?", + "choices" : [ + "Sahara", + "Gobi", + "Kalahari", + "Arctic" + ], + "answer" : "Sahara" + }, + { + "question" : "What is the smallest continent?", + "choices" : [ + "Australia", + "Europe", + "Asia", + "Africa" + ], + "answer" : "Australia" + }, + { + "question" : "What is the largest continent?", + "choices" : [ + "Asia", + "Africa", + "Europe", + "Antarctica" + ], + "answer" : "Asia" + }, + { + "question" : "What planet is closest to the Sun?", + "choices" : [ + "Mercury", + "Venus", + "Earth", + "Mars" + ], + "answer" : "Mercury" + }, + { + "question" : "What planet is farthest from the Sun?", + "choices" : [ + "Neptune", + "Mars", + "Earth", + "Venus" + ], + "answer" : "Neptune" + }, + { + "question" : "What bird cannot fly?", + "choices" : [ + "Ostrich", + "Eagle", + "Sparrow", + "Parrot" + ], + "answer" : "Ostrich" + }, + { + "question" : "Which mammal can fly?", + "choices" : [ + "Bat", + "Cat", + "Dog", + "Horse" + ], + "answer" : "Bat" + }, + { + "question" : "What animal has a trunk?", + "choices" : [ + "Elephant", + "Rhino", + "Horse", + "Lion" + ], + "answer" : "Elephant" + }, + { + "question" : "What animal has stripes?", + "choices" : [ + "Tiger", + "Lion", + "Bear", + "Elephant" + ], + "answer" : "Tiger" + }, + { + "question" : "What animal lays eggs?", + "choices" : [ + "Chicken", + "Dog", + "Cat", + "Cow" + ], + "answer" : "Chicken" + }, + { + "question" : "Largest planet in solar system?", + "choices" : [ + "Jupiter", + "Mars", + "Earth", + "Venus" + ], + "answer" : "Jupiter" + }, + { + "question" : "Smallest planet in the solar system?", + "choices" : [ + "Mercury", + "Mars", + "Venus", + "Earth" + ], + "answer" : "Mercury" + }, + { + "question" : "What direction is the opposite of up?", + "choices" : [ + "Down", + "Left", + "Right", + "Back" + ], + "answer" : "Down" + }, + { + "question" : "Hot drink from beans?", + "choices" : [ + "Coffee", + "Tea", + "Milk", + "Water" + ], + "answer" : "Coffee" + }, + { + "question" : "What is the day after Sunday?", + "choices" : [ + "Monday", + "Tuesday", + "Saturday", + "Friday" + ], + "answer" : "Monday" + }, + { + "question" : "What is the longest river?", + "choices" : [ + "Nile", + "Amazon", + "Yangtze", + "Mississippi" + ], + "answer" : "Nile" + }, + { + "question" : "What is the highest mountain?", + "choices" : [ + "Everest", + "K2", + "Kangchenjunga", + "Denali" + ], + "answer" : "Everest" + }, + { + "question" : "What is the largest country?", + "choices" : [ + "Russia", + "Canada", + "China", + "USA" + ], + "answer" : "Russia" + }, + { + "question" : "Language spoken in Spain?", + "choices" : [ + "Spanish", + "French", + "German", + "Italian" + ], + "answer" : "Spanish" + }, + { + "question" : "Language spoken in France?", + "choices" : [ + "French", + "Spanish", + "English", + "German" + ], + "answer" : "French" + }, + { + "question" : "Language spoken in Germany?", + "choices" : [ + "German", + "English", + "Spanish", + "Italian" + ], + "answer" : "German" + }, + { + "question" : "Language spoken in Italy?", + "choices" : [ + "Italian", + "French", + "Spanish", + "German" + ], + "answer" : "Italian" + }, + { + "question" : "Hot beverage from leaves?", + "choices" : [ + "Tea", + "Coffee", + "Milk", + "Water" + ], + "answer" : "Tea" + }, + { + "question" : "Round fruit, red or green?", + "choices" : [ + "Apple", + "Banana", + "Orange", + "Grape" + ], + "answer" : "Apple" + }, + { + "question" : "Long yellow fruit?", + "choices" : [ + "Banana", + "Apple", + "Orange", + "Mango" + ], + "answer" : "Banana" + }, + { + "question" : "Orange citrus fruit?", + "choices" : [ + "Orange", + "Apple", + "Banana", + "Pear" + ], + "answer" : "Orange" + }, + { + "question" : "Green citrus fruit?", + "choices" : [ + "Lime", + "Lemon", + "Orange", + "Grapefruit" + ], + "answer" : "Lime" + }, + { + "question" : "Animal that quacks?", + "choices" : [ + "Duck", + "Goose", + "Chicken", + "Turkey" + ], + "answer" : "Duck" + }, + { + "question" : "Animal that oinks?", + "choices" : [ + "Pig", + "Cow", + "Dog", + "Sheep" + ], + "answer" : "Pig" + }, + { + "question" : "Animal that moos?", + "choices" : [ + "Cow", + "Pig", + "Dog", + "Horse" + ], + "answer" : "Cow" + }, + { + "question" : "What animal has a mane?", + "choices" : [ + "Lion", + "Tiger", + "Elephant", + "Horse" + ], + "answer" : "Lion" + }, + { + "question" : "What animal has a hump?", + "choices" : [ + "Camel", + "Horse", + "Elephant", + "Donkey" + ], + "answer" : "Camel" + }, + { + "question" : "What animal can hop?", + "choices" : [ + "Kangaroo", + "Lion", + "Tiger", + "Elephant" + ], + "answer" : "Kangaroo" + }, + { + "question" : "What animal can swim?", + "choices" : [ + "Fish", + "Dog", + "Cat", + "Horse" + ], + "answer" : "Fish" + }, + { + "question" : "Which animal can fly?", + "choices" : [ + "Bird", + "Cat", + "Dog", + "Elephant" + ], + "answer" : "Bird" + }, + { + "question" : "What animal has a shell?", + "choices" : [ + "Turtle", + "Dog", + "Cat", + "Horse" + ], + "answer" : "Turtle" + }, + { + "question" : "What animal has tusks?", + "choices" : [ + "Elephant", + "Lion", + "Horse", + "Tiger" + ], + "answer" : "Elephant" + }, + { + "question" : "Color of coal?", + "choices" : [ + "Black", + "White", + "Red", + "Green" + ], + "answer" : "Black" + } + ] +} diff --git a/Assets/Datasets/Trivia.json.meta b/Assets/Resources/Trivia.json.meta similarity index 100% rename from Assets/Datasets/Trivia.json.meta rename to Assets/Resources/Trivia.json.meta diff --git a/Assets/Scripts/WindowComponents.cs b/Assets/Scripts/WindowComponents.cs index fce4293..9bab3df 100644 --- a/Assets/Scripts/WindowComponents.cs +++ b/Assets/Scripts/WindowComponents.cs @@ -1,12 +1,12 @@ using UnityEngine.UI; using UnityEngine; -using UnityEngine.Serialization; namespace InterfaceOff { public class WindowComponents : MonoBehaviour { [field: SerializeField] public Image WindowImage { get; private set; } + [field: SerializeField] public RectTransform TopBarRectTransform { get; private set; } [field: SerializeField] public RectTransform RectTransform { get; private set; } [field: SerializeField] public RectTransform CloseButtonRectTransform { get; private set; } [field: SerializeField] public Text InfoText { get; private set; } @@ -18,5 +18,16 @@ namespace InterfaceOff RectTransform.rect.width, RectTransform.rect.height ); + + public void SetWidth(float width) + { + RectTransform.sizeDelta = new Vector2(width, RectTransform.sizeDelta.y); + + WindowImage.rectTransform.sizeDelta = new Vector2(width, 200); + TopBarRectTransform.sizeDelta = new Vector2(width, 40); + + CloseButtonRectTransform.anchoredPosition = new Vector2(width / 2 - 20, 0); + InfoText.rectTransform.sizeDelta = new Vector2(width - 40, 30); + } } } \ No newline at end of file diff --git a/Assets/Scripts/WindowSpawner.cs b/Assets/Scripts/WindowSpawner.cs index 2dda9c2..6f97530 100644 --- a/Assets/Scripts/WindowSpawner.cs +++ b/Assets/Scripts/WindowSpawner.cs @@ -41,6 +41,8 @@ namespace InterfaceOff go.SetActive(true); Type type = WindowTypes.GetRandom(); + go.name = type.Name; + WindowBase windowBase = go.AddComponent(type) as WindowBase; /* Checks it created correctly before instantiating further */ diff --git a/Assets/Scripts/Windows/TriviaWindow.cs b/Assets/Scripts/Windows/TriviaWindow.cs new file mode 100644 index 0000000..ab6472f --- /dev/null +++ b/Assets/Scripts/Windows/TriviaWindow.cs @@ -0,0 +1,53 @@ +using System.IO; +using UnityEngine; + +namespace InterfaceOff +{ + [System.Serializable] public struct TriviaQuestion + { + public string question; + public string[] choices; + public string answer; + } + + [System.Serializable] public struct TriviaSet + { + public TriviaQuestion[] questions; + } + + public class TriviaWindow : WindowBase + { + private static TriviaSet Trivia; + + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] + private static void LoadTriviaSet() + { + string path = Application.dataPath + "/Resources/Trivia.json"; + string json = File.ReadAllText(path); + + Trivia = JsonUtility.FromJson(json); + + string longest = ""; + int length = 0; + + foreach (TriviaQuestion question in Trivia.questions) + { + if (length < question.question.Length) + { + length = question.question.Length; + longest = question.question; + } + } + + Debug.Log(longest); + } + + public override void OnWindowInstantiation() + { + TriviaQuestion question = Trivia.questions[Random.Range(0, Trivia.questions.Length)]; + Components.InfoText.text = question.question; + + Components.SetWidth(500); + } + } +} diff --git a/Assets/Scripts/Windows/TriviaWindow.cs.meta b/Assets/Scripts/Windows/TriviaWindow.cs.meta new file mode 100644 index 0000000..474fbc0 --- /dev/null +++ b/Assets/Scripts/Windows/TriviaWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c11be2f2ebd10b4dafb50bb17c06112 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: