This repository has been archived on 2026-04-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ludumdare41/Assets/Scripts/LollipopSaysHi.cs
T
Logic Monkey 47713e6012 Sounds added
2018-04-22 19:11:55 -04:00

30 lines
670 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LollipopSaysHi : MonoBehaviour {
float timeAccumulated;
public float timeTillWave = 10;
// Use this for initialization
Animator a;
void Start () {
timeAccumulated = Random.Range(0, timeTillWave);
a = GetComponent<Animator>();
}
// Update is called once per frame
void Update () {
timeAccumulated += Time.deltaTime;
if (timeAccumulated >= timeTillWave)
{
if (Random.Range(0, 2) == 0)
{
a.SetTrigger("SayHi");
}
timeAccumulated = 0;
}
}
}