aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiakata <miakata@gmail.com>2019-04-27 18:08:27 +0200
committermiakata <miakata@gmail.com>2019-04-27 18:08:27 +0200
commita5df3253047945b54a5ec25c3661b2c4967460e7 (patch)
treec5b42f3f39c2a65aa644d8d51542ee983a60edfd /nGJ2019/Assets/Scripts/Messenger.cs
parent7568372af43405a0d2b1d1a3adb7f817527098db (diff)
parent53a8d342ee667d1b28c1dc1e173ad73338a930b9 (diff)
Merge branch 'master' of https://github.com/marcinzelent/ngj2019
Diffstat (limited to 'nGJ2019/Assets/Scripts/Messenger.cs')
-rw-r--r--nGJ2019/Assets/Scripts/Messenger.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/nGJ2019/Assets/Scripts/Messenger.cs b/nGJ2019/Assets/Scripts/Messenger.cs
new file mode 100644
index 0000000..ca2ffe1
--- /dev/null
+++ b/nGJ2019/Assets/Scripts/Messenger.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class Messenger : MonoBehaviour
+{
+ public Text MainText;
+ public ObstacleSpawner Spawner;
+ private EventTimeline timeline;
+
+ // Start is called before the first frame update
+ void Start()
+ {
+ timeline = Spawner.GetEventTimeline();
+
+ timeline.Add(1, "Test");
+
+ timeline.OnMessageEvent += MessageOnEvent;
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+
+ }
+
+ void MessageOnEvent(EventTimeline.MessageEvent e)
+ {
+ MainText.text = e.message;
+ }
+}