quakeball/Assets/Scripts/Net/CanvasInput.cs

30 lines
827 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
2020-08-02 20:32:30 +02:00
using NeonTea.Quakeball.Net.Peers;
namespace NeonTea.Quakeball.Net {
public class CanvasInput : MonoBehaviour {
public Button Host;
public Button Join;
public InputField HostAddr;
public InputField Port;
void Start() {
Host.onClick.AddListener(() => {
//Destroy(Join.gameObject);
//Host.interactable = false;
2020-08-02 20:32:30 +02:00
Net.Singleton.Start(new Server(), "0.0.0.0", 8080);
});
Join.onClick.AddListener(() => {
//Destroy(Host.gameObject);
//Join.interactable = false;
2020-08-02 20:32:30 +02:00
Net.Singleton.Start(new Client(), "127.0.0.1", 8080);
});
}
}
}