Sign In Register

How can we help you today?

Start a new topic

RTSessionInfo not found...

I keep getting the error: RTSessionInfo not found in current context... Here is my code:

 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

using GameSparks.Core;
using GameSparks.RT;


public class ChatManager : MonoBehaviour {

	public GameObject chatWindow;
	public Button toggleChatButton;
	private bool isChatOpen;
	public InputField messageInput;
	public Dropdown recipientOption;
	public Button sendMessageBttn;

	public Text chatLogOutput;
	public int elementsInChatLog = 7;
	private Queue<string> chatLog = new Queue<string>();

	// Use this for initialization
	void Start () {
		chatWindow.SetActive (false);
		toggleChatButton.onClick.AddListener (toggleChatWindow);
	
		foreach (RTSessionInfo.RTPlayer player in GameSparksManager.Instance().GetSessionInfo().GetPlayerList()) {
			// we don't want to add the option to send a message to ourselves, so we'll use our own peerId to exclude this option; we'll only be able to send messages to others //
			if (player.peerId != GameSparksManager.Instance().GetRTSession().PeerId) {
				recipientOption.options.Add (new Dropdown.OptionData () { text = player.displayName });
			}
		}
	}


	void toggleChatWindow(){
		if (isChatOpen) {
			//hide it
			isChatOpen = false;
			chatWindow.SetActive (false);
			toggleChatButton.transform.GetComponentInChildren<Text> ().text = "Start Chat";
		} else {
			//show it
			isChatOpen = true;
			chatWindow.SetActive (true);
			toggleChatButton.transform.GetComponentInChildren<Text> ().text = "End Chat";
		}
	}

	// Update is called once per frame
	void Update () {
		
	}
} 

  


1 person has this question
Login to post a comment