Beispiel #1
0
 void Start()
 {
     if (labelFader == null) {
         labelFader = GameObject.FindWithTag("GUIBigLabel").GetComponent<GUIBigLabelFader>();
     }
     if(labelFader == null) Debug.LogWarning("Could not find #GUIBigLabel");
 }
	void Update() {
		if (infoTextFader == null) {
			infoTextFader = GameObject.FindWithTag ("GUIBigLabel").GetComponent<GUIBigLabelFader>();
		}

		if (chat == null) {
			GameObject chatObject = GameObject.FindWithTag("Chat");
			if(chatObject != null) {
				chat = chatObject.GetComponent<ChatController>();
			}
		}

		if (!connected && connectionMaintainer.connected) {
			AudioSource.PlayClipAtPoint(connectionEstabilishedSound, Camera.main.transform.position);
			infoTextFader.Show("Connected");
			if(chat != null) chat.AddMessage("Connected to alternativ-mud on "+hostname+":"+port);

			if(!authDataCorrect) {
				guiLoginPanelScript.enabled = true;
			}
		}
		if (!connectionFailed && connectionMaintainer.connectionFailed) {
			AudioSource.PlayClipAtPoint(connectionFailedSound, Camera.main.transform.position);
			infoTextFader.Show("Connection failed");
			if(chat != null) chat.AddMessage("Connection to alternativ-mud failed on "+hostname+":"+port);
		}
		connected = connectionMaintainer.connected;
		connectionFailed = connectionMaintainer.connectionFailed;
	}