Projekt

Obecné

Profil

Stáhnout (833 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
using System.Collections;
2
using System.Collections.Generic;
3
using UnityEngine;
4
using UnityEngine.UI;
5
using DeltaRobotVr;
6

    
7
public class StatusScript : MonoBehaviour
8
{
9
    private const string STATUS = "Status:\n";
10
    private const string CONNECTED = "<color=green>Connected</color>";
11
    private const string CONNECTING = "<color=red>Connecting...</color>\n";
12
    private Text _textComp;
13
    // Start is called before the first frame update
14
    void Start()
15
    {
16
        _textComp = GetComponent<Text>();
17
    }
18

    
19
    // Update is called once per frame
20
    void Update()
21
    {
22
        if (Client.Instance.IsConnected)
23
        {
24
            _textComp.text = STATUS + CONNECTED;
25
        }
26
        else
27
        {
28
            _textComp.text = STATUS + CONNECTING + Client.Instance.EotMsg;
29
        }
30
    }
31
}
(17-17/18)