From 96c7cad42ad3b3702dc0541537982467e080f649 Mon Sep 17 00:00:00 2001 From: Erno Lokkila <eolokk@utu.fi> Date: Sun, 3 Mar 2019 22:01:07 +0200 Subject: [PATCH] Flag wobbles --- Assets/Scripts/Flag.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Assets/Scripts/Flag.cs b/Assets/Scripts/Flag.cs index fd1157d..4f1c7f9 100644 --- a/Assets/Scripts/Flag.cs +++ b/Assets/Scripts/Flag.cs @@ -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; + } + } } -- GitLab