View the following C# Script carefully. Assume that the Script is enabled, is attached to an...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
View the following C# Script carefully. Assume that the Script is enabled, is attached to an active GameObject, and addresses the appropriate namespaces first. 1. Discuss what condition(s) in the game will cause the OnTriggerEnter() function to be executed? 2 Discuss what happens in this OnTriggerEnter() function, using line numbers as references to your discussion. You should discuss the following: • The If statement on line 14 o The Switch statement and its multiple cases. • The Else If statement on line 32 o Each line of code from line 34 to 36. 1 public class IfThenStatement : MonoBehaviour 2 { 3 public Text helpText; 4 private int dogs; 6 void Start() 7 8 helpText.text = "": 9 dogs = 0; 10 11 12 void OnTriggerEnter (Collider other) 13 { 14 if (other.gameObject.CompareTag("QuestPerson")) 15 { 16 switch (dogs) 17 18 case 0: 19 helpText.text = "Please find my two dogs!"; 20 break; 21 case 1: 22 helpText.text = "You found one! Please find my other dog!"; 23 break; 24 case 2: 25 helpText.text = "You found both of my dogs! Thank you!"; 26 break; 27 default: 28 helpText.text - "Quest error."; 29 break; 30 } 31 32 else if (other.gameobject.CompareTag("LostDog")) 33 { 34 other.gameObject.tag "FoundDog"; 35 helpText.text = "You found a dog! It begins to follow you."; 36 dogs++; View the following C# Script carefully. Assume that the Script is enabled, is attached to an active GameObject, and addresses the appropriate namespaces first. 1. Discuss what condition(s) in the game will cause the OnTriggerEnter() function to be executed? 2 Discuss what happens in this OnTriggerEnter() function, using line numbers as references to your discussion. You should discuss the following: • The If statement on line 14 o The Switch statement and its multiple cases. • The Else If statement on line 32 o Each line of code from line 34 to 36. 1 public class IfThenStatement : MonoBehaviour 2 { 3 public Text helpText; 4 private int dogs; 6 void Start() 7 8 helpText.text = "": 9 dogs = 0; 10 11 12 void OnTriggerEnter (Collider other) 13 { 14 if (other.gameObject.CompareTag("QuestPerson")) 15 { 16 switch (dogs) 17 18 case 0: 19 helpText.text = "Please find my two dogs!"; 20 break; 21 case 1: 22 helpText.text = "You found one! Please find my other dog!"; 23 break; 24 case 2: 25 helpText.text = "You found both of my dogs! Thank you!"; 26 break; 27 default: 28 helpText.text - "Quest error."; 29 break; 30 } 31 32 else if (other.gameobject.CompareTag("LostDog")) 33 { 34 other.gameObject.tag "FoundDog"; 35 helpText.text = "You found a dog! It begins to follow you."; 36 dogs++;
Expert Answer:
Answer rating: 100% (QA)
From the given image it can be inferred that this part of the code deals with a quest ingame which n... View the full answer
Related Book For
Business Communication
ISBN: 978-1439080153
8th edition
Authors: Buddy Krizan, Patricia Merrier, Joyce P. Logan, Karen Schneiter Williams
Posted Date:
Students also viewed these computer network questions
-
In each game following, what happens if Jack goes first? 1. 2. 3. 4. 5. 6. 7. 8. Jack's Strategy Left Jack gets 1 Jill gets 1 Right Jack gets4 Jill gets 2 Up Jill's Strategy Jack gets 2 Jack gets 3...
-
In each game following, what happens if Jill goes first? 1. 2. 3. 4. 5. 6. 7. 8. Jack's Strategy Left Jack gets 1 Jill gets 1 Right Jack gets4 Jill gets 2 Up Jill's Strategy Jack gets 2 Jack gets 3...
-
What happens if a limited partner takes an active role in managing the business?
-
Refer to Figure 9.3. Svetlana scores 0.70 on the responsibility scale of the CPI. Dymitri scores 0.30 on the responsibility scale of the CPI. By how many T-score points do their scores differ? Figure...
-
Telamark Company uses the moving weighted average method for inventory costing. The following incomplete inventory sheet regarding Product W506 is available for the month of March 2014: Required:...
-
Draw the structure of a phosphodiester linkage.
-
The thermal efficiency of gas turbine as compared to diesel engine is (a) higher (b) lower (c) same (d) unpredictable.
-
During the month of February, Morrisey Corporations employees earned wages of $74,000. Withholdings related to these wages were $5,661 for Social Security (FICA), $7,100 for federal income tax, and...
-
In a criminal trial, the prosecution seeks to prove that the defendant, Calvin Broadus robbed a store. There was a witness named Christopher Wallace who told a police officer named Jermaine Cole that...
-
In June 2021, Karen transferred property with a $75,000 FMV and a $20,000 adjusted basis to Hal, her husband. Hal dies in March 2022; the property has appreciated to $85,000 in value by then. His...
-
A space for storing boxes is 36 inches high. Each box is 6 inches high. A space of 9 inches must be left at the top.
-
What impact does working remotely has on an employee and employer? Provide thorough explanation and incited references.
-
2.A student must come back to the learning laboratory to repeat the skills and check for insertion of a nasogastric tube. The instructor overhears the student saying, I know I can do this, I know I...
-
1. The RN is talking with the unit manager about ways to improve patient care. The manager introduces the concept of a cohNort. Which statement by the RN indicates that the teaching has been...
-
A car traveling at a certain speed undergoes a head-on collision with an identical vehicle traveling at the same speed, and both come to rest in 10ms. Now suppose, instead, that the car crashes into...
-
You calculated that a certain gas travels at 332m/s at room temperature. Your friend offers to travel 332 meters away from you with a highly sensitive detector so that you can allow the gas sample to...
-
Labor estimating is normally recorded in both hours and dollars. An element in the work breakdown structure was estimated to require one month for accomplishment. The element was estimated at 1,000...
-
Show, if u(x, y) and v(x, y) are harmonic functions, that u + v must be a harmonic function but that uv need not be a harmonic function. Is e"e" a harmonic function?
-
Is conflict always unhealthy? Why or why not?
-
What are three characteristics of a blog?
-
Display the following dateline, inside address, salutation, and text as (a) A letter using full block format and open punctuation, (b) A letter using modified block format with indented paragraphs...
-
Describe what sexual harassment is and what forms it can take.
-
Explain public policies that protect employees from unlawful discharge.
-
Discuss under what conditions unemployment compensation can be denied to a claimant.
Study smarter with the SolutionInn App