Skip to content
Snippets Groups Projects
Commit 96c7cad4 authored by Erno Lokkila's avatar Erno Lokkila
Browse files

Flag wobbles

parent 7b221229
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,10 @@ public class Flag : MonoBehaviour
[SerializeField]
private GameObject Worker;
private void Start()
{
StartCoroutine("resize");
}
public void SetWorker(GameObject w)
{
this.Worker = w;
......@@ -15,4 +19,15 @@ public class Flag : MonoBehaviour
{
return this.Worker;
}
private IEnumerator resize() {
int multiplier = 1;
while (true) {
for (int i = 0; i < 100; i++) {
yield return new WaitForSeconds(0.01f);
transform.localScale = transform.localScale + new Vector3(0.01f,0.01f,0)*multiplier;
}
multiplier *= -1;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment