void Start() { Lives = 3; firstPosition = new Vector2(-2.47f, 4.4f); swapper.ToggleObjectsColor(ColorNames.Green); inAnimation = true; StartCoroutine(StartInitialAnimation(Vector2.zero)); }
// Update is called once per frame void Update() { if (!isChanging) { return; } if (_timer > 0) { _timer -= Time.deltaTime; } else { if (colorEnum.MoveNext() && pointEnum.MoveNext()) { swapper.ToggleObjectsColor(colorEnum.Current); Score = pointEnum.Current; _timer = timer; } else { _timer = 0; } } }
void Awake() { EventList.playerDeath += Grub_OnPlayerDeath; EventList.waveChanged += Grub_OnWaveChanged; swapper = GetComponent <ColorSwapper>(); swapper.ToggleObjectsColor(ColorNames.White); Score = 500; _timer = timer; colorEnum = colors.GetEnumerator(); pointEnum = points.GetEnumerator(); }