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

public class ActivateShortcut : MonoBehaviour
{
    public GameObject shortcutGO;
    public bool activated;

    private void OnTriggerEnter(Collider other)
    {
        if (!activated && other.GetComponentInParent<PlayerController>())
        {
            Activate();
        }
    }

radow's avatar
radow committed
18
    public string Activate()
radow's avatar
radow committed
19
20
21
    {
        activated = true;
        shortcutGO.SetActive(true);
radow's avatar
radow committed
22
        return "Shortcut activated";
radow's avatar
radow committed
23
24
    }
}