มาเริ่มกันเลยครับ
1. ให้ทำการสร้าง UI ดังรูปนะครับ (โดยทำการสร้าง Input Field สำหรับ Username & Password และ ปุ่มสำหรับ Login & Cancel)
using UnityEngine;
using System.Collections.Generic;
using UnityEngine.UI;
public class LoginController : MonoBehaviour
{
public InputField username;
public InputField password;
// ทำการ debug ค่าที่ได้จาก Input Field
public void Login()
{
Debug.Log("Username : " + username.text);
Debug.Log("Password : " + password.text);
}
// ทำการ clear ค่า
public void ClearForm()
{
username.text = "";
password.text = "";
}
}