3-ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate - Attempt review

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Dashboard / My courses /
depa-unity /
General /
ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate

Started on Friday, 8 October 2021, 3:57 PM


State Finished
Completed on Friday, 8 October 2021, 4:20 PM
Time taken 22 mins 59 secs
Grade 32.58 out of 40.00 (81%)

Question 1
You have been
asked to build the code listens for the up arrow and scales up the y axis of an
object continually as long as
Complete
the arrow is held down.
Mark 0.50 out of
1.00 Complete the
code by drag and drop the correct options from lists
Answer Area
                    public class ScalePlatform
: MonoBehaviour

                    {
                           public float
scaleFactor;

                           void Update()


                           {

                                  if( Input.GetKey


  (Key.UpArrow)
 

                                  {

                                        IncreaseScale();
                                  }

                           }
                           private void
IncreaseScale()

                           {
                            
gameObject.transform.localScale = new Vector3(transform.localScale.x, transform.localScale.y
+ scaleFac

                           }
                   }

(KeyCode.UpArrow)) Input.GetKeyUp

Question 2
Select whether statement about is True or False
Complete
A function that returns a value must use the return keyword.
Mark 1.00 out of
1.00

Select one:
True

False

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 1/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 3
Evaluate if
the code snippet are using ECS libraries. Choose True for code snippet that is
using ECS and False for code
Complete
snippet that is not using ECS
Mark 1.00 out of
1.00 using
Unity.Entities;

using
UnityEngine;
public class
ShieldComponent : MonoBehavior

      {
      public float Protection;

      public float Size;


      }

Select one:
True

False

Question 4
Select
whether code snippet is using ECS by selecting True or False.
Complete
using
Unity.Entities;
Mark 1.00 out of
1.00 using
UnityEngine;

public class
KeyboardComponent : MonoBehavior
{

     public float Horizontal;


     public float Vertical;

Select one:
True

False

Question 5
Your code is causing the error NullreferenceException: Object
reference not set to an instance of an object.
Complete
Which line of code is causing the error?
Mark 1.00 out of
1.00

Select one:
a. float Xmax;

b. int score;

c. bool hasLanded;

d. GameObject projectile;

Question 6
Select whether a statement is True or False
Complete
The void keyword indicates that a function will return a
null value.
Mark 1.00 out of
1.00
Select one:
True

False

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 2/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 7
Select
whether code snippet is using ECS by selecting True or False.
Complete
using
UnityEngine;

Mark 0.00 out of


1.00 using System.Collections;

public class KeyboardScript : MonoBehaviour

      public class Wizard

      {

           public int fireballs;

           public int shields;

           public int missiles;

      }

Select one:
True

False

Question 8
Select whether the code snippet is using ECS by selecting
True or False.
Complete
     using UnityEngine;
Mark 1.00 out of
1.00      using Unity.Entities;

     using Unity.Mathematics;
     public struct EntityData : IComponentData {

Select one:
True

False

Question 9
Evaluate if
the code snippet are using ECS libraries. Choose True for code snippet that is
using ECS and False for code
Complete
snippet that is not using ECS
Mark 1.00 out of
1.00 using
Unity.Entities;
using
UnityEngine;

public class
EnemyMovementSystem : ComponentSystem
     {

     public Rigidbody Rigidbody;


     public InputComponent Inputcomponent;

     }

Select one:
True

False

Question 10
Select whether statement about is True or False
Complete
A function will not execute unless it is called first.
Mark 1.00 out of
1.00

Select one:
True

False

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 3/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 11
Select whether the code snippet is using ECS by selecting
True or False.
Complete
    using System;
Mark 1.00 out of
1.00     using UnityEngine;
    using Unity.Entities;

    [Serializable]
    public struct EntityData : IComponentData {

Select one:
True

False

Question 12
Select
whether code snippet is using ECS by selecting True or False.
Complete
using
UnityEngine;

Mark 1.00 out of


1.00 using System.Collections;

public class  Movement : MonoBehaviour

      public float speed;

      public float turnSpeed;

      void Update ()

      {

      Movement();

      }

Select one:
True

False

Question 13
Select whether statement about is True or False
Complete
A function can be passed more than one type of parameter.
Mark 1.00 out of
1.00

Select one:
True

False

Question 14
Select whether code snippet is using ECS by selecting
True or False.
Complete
     using Unity.Jobs;
Mark 0.00 out of
1.00      using Unity.Burst;

     using Unity.Mathematics;
     using UnityEngine;

     public class EntityData :


MonoBehaviour {

Select one:
True

False

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 4/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 15
Evaluate if
the code snippet are using ECS libraries. Choose True for code snippet that is
using ECS and False for code
Complete
snippet that is not using ECS
Mark 0.00 out of
1.00 using
UnityEngine;

using
System.Collections;
public class
Fireball : MonoBehaviour

{
      public Rigidbody fireballPrefab;

      public Transform firePosition;


      public float fireballSpeed;

Select one:
True

False

Question 16
Which three selections can a
State Machine contain within the Unity Animator Controller? (Choose Three)
Complete

Mark 1.00 out of


1.00
Select one or more:
a. Scenes

b. Events

c. Transitions

d. Objects

e. States

f. Tags

Question 17 Given the reference type Animator, use the drop-down lists to set the animator's Boolean parameters to Attacking and to
Complete False.

Mark 1.00 out of


Complete the code by Drag and Drop select the correct option in the lists.

1.00
Answer Area

Animator animator;
void OnTriggerEnter2D(Collider2D collider)

{
GameObject obj = collider.gameObject;

if(obj.GetComponent<player>())
{

animator
  .SetBool  ("Attacking" , False);
 

(Attacking , False); Animator

(Attacking ,"False");

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 5/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 18 Analyze statement about the Game View screen when in Play Mode in the Unity editor.  Select if statement is True or
Complete False.

Mark 1.00 out of


The camera perspective of your game can be seen in the Game View window.

1.00

Select one:
a. True

b. False

Question 19 Given the output below, select the correct operators and place them in the target areas.

Complete
Enemies created:  0
Mark 1.00 out of
1.00 Enemies created:  1
Enemies created:  2

Enemies created:  3
Enemies created:  4

Enemies created:  5
Enemies created:  6

Enemies created:  7
Enemies created:  8

Enemies created:  9
Enemies created:  10

Answer Area

int enemies = 10;

void Start()
{

for (int i =  0;  i <=


  enemies; i ++
  )

Debug.Log("Enemies created:  " + i);


}

>= ‑‑

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 6/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 20 To answer this question, use the AddForceAPI that accepts a Vector value and a numerical value.

Complete
You need to apply a force value to a RigidBody that is attached to a GameObject.  The force must move the object in the
Mark 0.50 out of direction it is facing.  You must use a force value that can be set in the inspector.
1.00
Complete the code by Drag and Drop select the correct option in the lists.

Answer Area

public class MovingThings : MonoBehavior

{
private float speedOfMotion;

public float speedForce;


private static float forceSpeed = 10f;

private Rigidbody rigidBody;


void Start()

{
speedOfMotion = 10f;

rigidBody = gameObject.Getcomponent<Rigidbody>();
}

void FixedUpdate()
{

rigidBody.AddForce(   *   )
transform.forward Vector2.facing
}

speedOfMotion forceSpeed

speedForce

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 7/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 21 You need to set up a mecanim state machine.  This machine will manage the animations of an object that has the
Complete following 4 state:  TurningOff, On, TurningOn, and Selected.

Mark 0.25 out of This machine's default state will be off.  Only when the object is in the On state, can it move to the Selected state.

1.00

Given the connections depicted in the graphic, match the object with the corresponding state.  Evaluate the graphic and
select the correct options from the lists.

1.  
Turning On
2.  
Turning Off
3.  
Select
4.  
On

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 8/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 22 You have been asked to create a function (only available in this script) that will turn on or turn off a game object.  This
Complete game object is controlled by mouse clicks on a different 3D object in the scene.

Mark 0.33 out of


Select the correct code snippets and place them in the correct area of the provided code.

1.00
Answer Area

public class TurnOnDisplay : MonoBehaviour


{

public GameObject displayPane;


private void Start()

{
displayPane.SetActive(false);

         
Public void OnMouseEnter()
{
if (displayPane.activeInHierarchy == false)

{
displayPane.SetActive(true);

}
else

{
displayPane.SetActive(false);

}
}

Private OnMouseUp()

MouseInfo
Question 23 Mark statement about the commented C# code in Unity as True or False

Complete
int iq = 145;
Mark 1.00 out of
1.00 // If IQ is greater than or equal to 140 a person is considered a genius.
if (iq >= 140)

Console.WriteLine("Genius");
else

Console.WriteLine("Not Genius");
The comment incorrectly capitolizes IQ which will stop the code from running due to the int iq being written with lower
case letters

Select one:
a. False

b. True

Question 24
The
move tool can be configured to display either the local or the global
orientation of an object.
Complete
This
statement about positioning objects in the scene view is True or False
Mark 1.00 out of
1.00

Select one:
True

False

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 9/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 25 Select whether code snippet follows standard Unity naming conventions by choosing True or False.

Complete
Public Class Myscript : Monobehavior{
Mark 1.00 out of
1.00 Public Light Thelight;

Private Light Secondlight;


}

Select one:
a. True

b. False

Question 26
Identity the property of the inspector window that
identifies whether or not an object is going to be pre-computed as
Complete
stationary.
Mark 0.00 out of
1.00

Select one:
a. Static 

b. Tag 

c. Lock 

d. Add Component 

Question 27
State machines can be created with or without a default
state.
Complete
This statement about state machine transitions in Unity
is True or False
Mark 0.00 out of
1.00

Select one:
True

False

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 10/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 28
Given the incomplete if statements, use the correct Input
Method to make the statements log the correct message to the
Complete
console.  Drag and Drop select the correct option in
the lists.
Mark 1.00 out of
1.00 Note:  Each correct answer is worth partial credit.

void Update()
{

if(Input. GetKey(KeyCode.LeftArrow))
 

{   

Debug.Log("Left Arrow key is being held down");


}

if(Input. GetKeyDown(KeyCode.UpArrow))
 

Debug.Log("Up Arrow key was pressed once");


}

if(Input. GetKeyUp(KeyCode.DownArrow))
 

Debug.Log("Down Arrow key was released");


}

GetKeyDown(KeyCode.DownArrow))

GetKeyUp(KeyCode.LeftArrow))

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 11/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 29 The sample code is producing an error on line 22 and 23 which returns:

Complete
'Transform' does not contain a definition for 'turretMount' and no accessible extension method '
Mark 1.00 out of
1.00 Transform' Could be found (are you missing a using directive or an assembly reference?)

Select the correct options to fix the error.

Select one:
a. WeaponControl

b. GameObject

c. Transform

d. Mount 

Question 30
You've
been asked to create a script for an object that gives off an explosive force
when initially touched by another
Complete
object.
Mark 1.00 out of
1.00 Complete the code by selecting the correct option

Select one:
a. void OnTriggerEnter()

b. void OnTriggerExit()

c. void OnStay()

d. void OnCollisionExit()

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 12/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 31 You are adding comments to your code.

Complete
if  (Input.GetButtonDown("Fire")){
Mark 1.00 out of
1.00 Rigidbody clone;

clone = Instantiate(projectile, transform.position, transform.rotation);


clone.velocity = transform.TransformDirection(Vector3.forward * 10);

}
Select the two comments that accurately describes what the code is doing (Choose 2)

Select one or more:


a. //Instantiate the projectile at the position and rotation of this transform  

b. //Destroy original object and replace with clone  

c. //Give the cloned object an initial velocity along the current object's Z axis 

d. //Instantiate a clone at the position. Have it fire on enemies  

Question 32
Choose True for code snippet that is using Unity Naming
Conventions and False for those that are not using unity naming
Complete
conventions
Mark 1.00 out of
1.00 private void ontriggerenter(Collider other)

{
     if(Other.compareTag("Player"))

     {
            PlaySound(enteringSound);

     }
}

Select one:
True

False

Question 33
Choose True for code snippet that is using Unity Naming
Conventions and False for those that are not using unity naming
Complete
conventions
Mark 1.00 out of
1.00 public class PlayerScript : MonoBehaviour  {

      public Light playerLight;

      void PlayerFunction ()  {

          playerLight.enabled =
!playerLight.enabled;

      }

Select one:
True

False

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 13/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 34 Match the console messages to their corresponding Debug.Log statement.

Complete
Answer Area

Mark 1.00 out of


1.00 Debug.Log("Local Position: " + gameObject.Transform.localPosition);  
Local Position: (0,150,26)
Debug.Log("Local Rotation: " + gameObject.Transform.localRotation);  

Debug.Log("Color: " + image.Color);


Local Rotation: (0,1,‑1,0)  

Debug.Log(gameObject.Name);  
Color: (0.54, 0.634, 0.19, 1)

GameObject

Question 35 After reviewing the code snippet below, determine what type return value the method should have.

Complete
Complete the code below by selecting the correct options.

Mark 1.00 out of


1.00

Select one:
a. void

b. Transform

c. Transform[] 

d. List<Transform>

Question 36
Public Class playerScript : MonoBehaviour  {

Complete
      public Light PlayerLight;

Mark 1.00 out of

1.00
      Void PlayerFunction ()  {

          PlayerLight.Enabled =
!PlayerLight.Enabled;

      }

Select one:
True

False

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 14/15
10/8/21, 4:23 PM ชุดฝึกฝนเพื่อเตรียมความพร้อมในการสอบ Unity Certificate: Attempt review

Question 37 Drag and drop each operator to its description.

Complete
not equal to !=
 
Mark 1.00 out of
1.00 increment ++
 

equal to ==
 

string concatenation + 

assignment = 

Question 38
Vertex snapping is used to snap a vertex of a selected
mesh to the scene grid
Complete
This statement about positioning objects in the scene
view is True or False
Mark 1.00 out of
1.00

Select one:
True

False

Question 39
In
this window, you can access and manage the assets that belong to your project.
Complete

Mark 1.00 out of


1.00
Select one:
a. The Scene Window

b. The Inspector Window  

c. The Hierarchy Window

d. The
Project Window

Question 40 Using the properties


from the Transform API below, complete the code by selecting the property that
will center the
Complete transform on its parent when assigned to location Vector3 zero

Mark 1.00 out of


localPosition  Position of the transform relative to the parent transform.
1.00
localRotation  The rotation of the transform relative to the transform rotation of the parent.

localScale  The scale of the transform relative to the parent.


parent  The parent of the transform.

position  The world space position of the Transform.

Select one:
a. Area

b. Rotate

c. Transform

d. Position

https://arit.co.th/lms/mod/quiz/review.php?attempt=5207&cmid=43 15/15

You might also like