PowenKo, Unity 3D, Input, iPhoneInput.touchCount and Input.GetButtonDown

September 6, 2011   ·   0 Comments


function Update () 
{	
	if ( !display && selection == -1 &&  iPhoneInput.touchCount > 0 )
	{
		for(var i : int = 0; i< iPhoneInput.touchCount;i++)
		{
			var touch : iPhoneTouch = iPhoneInput.GetTouch(i);
			// Check whether we are getting a touch and that it is within the bounds of
			// the title graphic
			if(touch.phase == iPhoneTouchPhase.Began && guiTexture.HitTest(touch.position))
			{
          		 dosomething();
			}			
		}
	}
	/////
	else if ( !display && selection == -1 && Input.GetButtonDown("Fire1")) 
	{
	
		var screenPos:Vector3 =Input.mousePosition;
			if( guiTexture.HitTest(screenPos))
			{

           		dosomething();
			}
     }
        
}
void dosomething(){
}
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Unity3D4

Amazon

adsbygoogle

Recent Posts

Categories

Amazon