Skip to content
Snippets Groups Projects
SelectedNewNetwServer_mobile.cs 3.32 KiB
Newer Older
using UnityEngine;
using UnityEngine.UI; //andr
Stefan Richter's avatar
Stefan Richter committed
using static LaunchMenu_mobile;
MaZiFAU's avatar
MaZiFAU committed
using static UIconfig;

public class SelectedNewNetwServer_mobile : MonoBehaviour
{
    public GameObject NewNAddrW;
    public GameObject NewNAddrT;
    public GameObject NewNAddrTS;
    public GameObject NewNAddrTI;
    public GameObject StartGwoS;
MaZiFAU's avatar
MaZiFAU committed


    private Color32 firstColB;
    private float transCol;
    private ColorBlock tempColB;


    void Start()
    {
        Update();
    }



    private void Update()
    {

        UpdateUI_6_f();
MaZiFAU's avatar
MaZiFAU committed

    }

    void UpdateUI_6_f()
    {
        //--------------------------------------------------------------------------

        if (CommunicationEvents.ServerRunningA[6] == 0 || CommunicationEvents.ServerRunningA[6] == 3)
        {
            NewNAddrW.GetComponent<Image>().color = colOffline;
            StartGwoS.GetComponent<Image>().color = colClear;
            StartGwoS.GetComponentInChildren<Text>().color = colClear;
            //GameObject.Find("StartGwoS").GetComponent<Image>().color = colClear;
            //GameObject.Find("SGwoST").GetComponent<Text>().color = colClear;
            if (string.IsNullOrEmpty(CommunicationEvents.selecIP))//; || ())
            {
                NewNAddrTI.GetComponent<Text>().text = "< empty >";
                NewNAddrTS.GetComponent<Text>().text = "Status: no ip-address";
            }
            else
            {
                NewNAddrTI.GetComponent<Text>().text = CommunicationEvents.selecIP;


                if (CommunicationEvents.ServerRunningA[6] == 0)
                {
                    NewNAddrTS.GetComponent<Text>().text = "Status: Offline";


                }
                else
                {
                    NewNAddrTS.GetComponent<Text>().text = "Status: no ip-address";
MaZiFAU's avatar
MaZiFAU committed

                }

            }
        }
        else
        {
            if (CommunicationEvents.ServerRunningA[6] == 2)
            {
                NewNAddrW.GetComponent<Image>().color = colOnline;
                NewNAddrTI.GetComponent<Text>().text = CommunicationEvents.selecIP;
                NewNAddrTS.GetComponent<Text>().text = "Status: Online";
                StartGwoS.GetComponent<Image>().color = Color.white;
                StartGwoS.GetComponentInChildren<Text>().color = Color.black;
MaZiFAU's avatar
MaZiFAU committed

            }
            else
            {
                StartGwoS.GetComponent<Image>().color = colClear;
                StartGwoS.GetComponentInChildren<Text>().color = colClear;
                NewNAddrW.GetComponent<Image>().color = colOffline;

                if (string.IsNullOrEmpty(CommunicationEvents.selecIP))//; || ())
                {
                    NewNAddrTI.GetComponent<Text>().text = "< empty >";

                    NewNAddrTS.GetComponent<Text>().text = "Status: no ip-address";

                }
                else
                {


                    NewNAddrTI.GetComponent<Text>().text = CommunicationEvents.selecIP;
                    NewNAddrTS.GetComponent<Text>().text = "Status: unknown";//"Status: checking";
                }


            }
        }
    }

    public void startNewIPGameButton()
    {
        if ((CommunicationEvents.ServerRunningA[6] == 2) && (CommunicationEvents.ServerRunningA[2] == 2))
        {
            startNextSceneFunctionNewGame();
        }
        else
        {
MaZiFAU's avatar
MaZiFAU committed