void Start() { // Inicialitzar aleatòriament la direcció de desplaçament walkingLeft = (Random.Range(0, 2) == 1); updateVisualWalkOrientation(); // Obtenir nombre de ronda actual GameObject roundWatcherObject = GameObject.FindGameObjectWithTag("RoundWatcher"); if (roundWatcherObject != null) { RoundWatcher roundWatcherComponent = roundWatcherObject.GetComponent <RoundWatcher>(); // Assignar velocitat segons ronda en curs walkingSpeed = walkingSpeed * roundWatcherComponent.currRound; } }
void Start() { // Randomly default the enemy’s direction walkingLeft = (Random.Range(0, 2) == 1); updateVisualWalkOrientation(); // Find the round watcher object GameObject roundWatcherObject = GameObject.FindGameObjectWithTag("RoundWatcher"); if (roundWatcherObject != null) { RoundWatcher roundWatcherComponent = roundWatcherObject.GetComponent <RoundWatcher>(); // Increase the enemy speed for each round. walkingSpeed = walkingSpeed * roundWatcherComponent.currRound; } }