This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
station_obscurum_unity/Assets/Scripts/Steam/FriendObject.cs

31 lines
775 B
C#
Raw Normal View History

2023-06-01 17:03:48 +02:00
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");
}
}
}
}