Helproom.cs 739 Bytes
Newer Older
radow's avatar
radow committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Helproom : MonoBehaviour
{
    public static Helproom currentRoom;

    public List<ActivateShortcut> shortcuts = new List<ActivateShortcut>();

    private void OnTriggerEnter(Collider other)
    {
        currentRoom = this;
    }

radow's avatar
radow committed
16
    public static string GetHelp()
radow's avatar
radow committed
17
    {
radow's avatar
radow committed
18
19
        if (currentRoom == null) return"No help available in this section.";
        var reply = "No more help available in this section.";
radow's avatar
radow committed
20
21
22
23
        foreach(ActivateShortcut s in currentRoom.shortcuts)
        {
            if (!s.activated)
            {
radow's avatar
radow committed
24
                reply = s.Activate();
radow's avatar
radow committed
25
26
27
                break;
            }
        }
radow's avatar
radow committed
28
29
        return reply;

radow's avatar
radow committed
30
31
    }
}