Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        // assign RoomSystem object
        roomPalette = GameObject.FindGameObjectWithTag("Rooms").GetComponent <RoomSystem>();

        // Invoke function on a delay to make sure spawning occurs properly
        Invoke("SpawnRoom", 0.1f);
    }
Exemple #2
0
    public override void OnEnter(GameStateContext context)
    {
        room = RoomSystem.Create(context.UserName);

        SceneManager.LoadScene("Lobby");

        EventSystem.AddListener(EventID.HandShake, OnHandShake);
    }
Exemple #3
0
 public static RoomSystem Create(string userName)
 {
     if (instance != null)
     {
         Debug.LogError("RoomSystem Exist!");
         return(instance);
     }
     instance          = new RoomSystem();
     instance.userName = userName;
     return(instance);
 }
Exemple #4
0
 static public int constructor(IntPtr l)
 {
     try {
         RoomSystem o;
         o = new RoomSystem();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
        private void OnPlayerConnected(object sender, ClientConnectedEventArgs e)
        {
            // If you have DR2 Pro, use the Plugin.Loaded() method instead
            if (_loginPlugin == null)
            {
                _loginPlugin           = PluginManager.GetPluginByType <Login>();
                _roomSystem            = PluginManager.GetPluginByType <RoomSystem>();
                _loginPlugin.onLogout += RemovePlayerFromChatGroups;
                ChatGroups["General"]  = new ChatGroup("General");
            }

            e.Client.MessageReceived += OnMessageReceived;
        }
Exemple #6
0
 static public int SearchRoom(IntPtr l)
 {
     try {
         RoomSystem   self = (RoomSystem)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         var ret = self.SearchRoom(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #7
0
 static public int GetRoomCount(IntPtr l)
 {
     try {
         RoomSystem  self = (RoomSystem)checkSelf(l);
         System.Byte a1;
         checkType(l, 2, out a1);
         var ret = self.GetRoomCount(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemple #8
0
 private void Awake()
 {
     instance = this;
 }
Exemple #9
0
	private void Awake(){
		instance = this;
	}
Exemple #10
0
 public void Destroy()
 {
     instance = null;
 }