Smoothed out a few things

This commit is contained in:
2018-04-23 10:12:50 +10:00
parent 47713e6012
commit cdfb834285
16 changed files with 465 additions and 88 deletions
+29
View File
@@ -0,0 +1,29 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Lollipop : MonoBehaviour {
Animator animator;
public float timeTillWave = 10;
float timeAccumulated;
void Awake () {
animator = GetComponent<Animator>();
timeAccumulated = Random.Range(0, timeTillWave);
}
void Update () {
timeAccumulated += Time.deltaTime;
if (timeAccumulated >= timeTillWave) {
if (Random.Range(0, 2) == 0) {
animator.SetTrigger("SayHi");
}
timeAccumulated = 0;
}
}
void OnTriggerEnter2D(Collider2D collider) {
//TODO: begin the end screen process
}
}