ตัวอย่างการใช้งาน
void Update()
{
if(Input.touchCount > 0) // ตรวจสอบว่ามีการ touch screen หรือ ไม่
{
// ทำการ loop จำนวนนิ้วที่ Touch Screen
for(int figerIndex = 0; figerIndex < Input.touchCount; figerIndex++)
{
// ทำการยิง projectile จากตำแหน่งที่ Touch Screen
Instantiate(projectile, Input.GetTouch(figerIndex).position, Quaternions.identity);
}
}
}