Kizspy | Question: 41
(Choose 1 answer)
What does the 'UpdateScore method do?
using UnityEngine;
public class Dynamic Event: MonoBehaviour {
public event System.Action<int> OnScoreChanged;
private int score;
public void UpdateScore (int points) {
score += points;
OnScoreChanged?.Invoke(score);
}
A. Moves the GameObject
B. Updates the score and triggers an event
C. Changes the GameObject's material
D. Logs the score