StationObscurum/Assets/Scripts/Steam/FriendObject.cs
2023-06-01 08:03:48 -07:00

31 lines
775 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Steamworks;
public class FriendObject : MonoBehaviour
{
public SteamId steamid;
public async void Invite()
{
if (SteamLobbyManager.UserInLobby)
{
SteamLobbyManager.CurrentLobby.InviteFriend(steamid);
Debug.Log("Invited " + steamid);
}
else
{
bool result = await SteamLobbyManager.CreateLobby();
if (result)
{
SteamLobbyManager.CurrentLobby.InviteFriend(steamid);
Debug.Log("Invited " + steamid + " Created a new lobby");
}
}
}
}