Pedro Gomes 4c3edff503 Crafting system working (WIP)
- Crafting UI fully functional
- Crafting Stat stones and modular equippable items fully functional
Notes:
- Urgent need for exclusive(auto sorted) inventory for stones only
- Something to do with the "trash" modular items instead of just selling
- Add new uses for gold besides equipment, preset items will probably be worthless with modular crafting
2025-01-06 19:52:31 +00:00

47 lines
1.1 KiB
C#

using Photon.Pun;
using Photon.Realtime;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class JoinParty : MonoBehaviour
{
[SerializeField] private StringSharedField partyName;
[SerializeField] private Button button;
private void Start()
{
button.interactable = false;
}
public void OnInputFieldChanged(string value)
{
partyName.Value = value;
button.interactable = !string.IsNullOrEmpty(value);
}
public void JoinOrCreateParty()
{
if(!PhotonNetwork.IsConnectedAndReady)
{
PhotonNetwork.ConnectUsingSettings();
StartCoroutine(JoinOrCreateAfterConnect());
button.interactable = false;
return;
}
PhotonNetwork.JoinOrCreateRoom(partyName.Value, new RoomOptions { MaxPlayers = 0, EmptyRoomTtl = 0 }, TypedLobby.Default);
button.interactable = false;
}
IEnumerator JoinOrCreateAfterConnect()
{
while (!PhotonNetwork.IsConnectedAndReady)
{
yield return null;
}
JoinOrCreateParty();
}
}