Hi Unity Community!
I’m very near completeing my iPhone project and have run into a few issues on my GUI, ive done searching and searching for different methods and ways to try to get pass this.
My main issue, like the thread title says, is trying to disable any iphone touch input thats detected on my guitexture button when its not being shown.
I’ll also being using the solution to this problem to disable the games controls when a menu is “on” below ill provide my simple replay button script, I’ve tried things like
gameObject.active = false/true
Script.enabled = true/false
to see if they would also disable the scripts associated with the GuiTextures to stop the iPhoneInput, both were unsuccessful as they wouldnt pop up as you play the game or, even beat the level.
Im not a programmer and have just been learning as I go along with this, if theres something I missed on the iPhone commands please point me in the right direction.
Again, I just need a simple line of code that disables the iPhone inputs thanks!
Below is my “replay” button, it pops up when the player either loses or wins a level, but its still sensitive to touch when its not being displayed.
var Replay : GUITexture;
function Update()
{
if (BeamTexture.energy == 0)
{
Replay.enabled = true;
transform.position.x = .646763;
}
else
{
Replay.enabled = false;
// this is where the Iphone input disable code would most likely go
if (ScoreCount.score >= ScoreCount.scorelimit)
{
Replay.enabled = true;
}
else
{
Replay.enabled = false;
// this is where the Iphone input disable code would most likely go
}
}
if(iPhoneInput.touchCount > 0)
{
var touch: iPhoneTouch = iPhoneInput.touches[0];
if(touch.phase == iPhoneTouchPhase.Began guiTexture.HitTest(touch.position))
{
Application.LoadLevel(Application.loadedLevel);
BeamTexture.energy = 600;
DeathBeamTexture.deathenergy = 200;
ScoreCount.score = 0;
}
}
}