ทำ Drop Down List กันดีกว่า
1. ก่อนอื่นให้ทำการสร้าง Button มาก่อนตั้งชื่อ DropDown และทำการสร้าง Panel อยู่ภายใต้ปุ่มตั้งชื่อ Container ดังรูป
6. จากนั้นทำการสร้าง Button ภายใต้ Panel List นั้น และให้ทำการ Add Component Layout Element ให้กับ Button โดยไปที่ Component => Layout => Layout Element และทำการ Set ค่า ดังรูป
8. จากนั้นทำการสร้าง C# Script (DropDownListController.cs) เพื่อความคุม Drop Down List ดังรูป
11. ในส่วนของ Button ภายใต้ List ให้ทำการ Add OnClick Event
- Event แรก ให้ทำการ Add DropDownListController GameObject จากนั้นเลือก OnDropDownActive() และ Set Parameter to false
- Event ที่ สอง ให้ทำการ Add DropDownListController GameObject จากนั้นเลือก OnClickList() และ Set Parameter เป็นค่าที่ต้องการ
เท่านี้ก็สามารถนำไปประยุกต์ ในเกมได้แล้วครับ
ปล. มีอะไรแนะนำได้นะครับ
No Game No Dream !!!