/** * * Disables both the image and TapGesture of that image. * Result: Image will no longer show and can no longer detect touch. * * String s is the iamge type you're trying to disable. * **/ private void DisableImage(string s) { if (s == "pause") { PauseImageScript pis = PauseImage.GetComponent <PauseImageScript>(); // Disable the tap gesture to prevent double touches. pis.DisableTapGesture(); // Disable image itself. PauseImage.GetComponent <Image>().enabled = false; } else if (s == "play") { PlayImageScript pis = PlayImage.GetComponent <PlayImageScript>(); // Disable the tap gesture to prevent double touches. pis.DisableTapGesture(); // Disable image itself. PlayImage.GetComponent <Image>().enabled = false; } else { } }
/* ======================================================================== HELPER FUNCTIONS DO NOT TOUCH ======================================================================== */ /** * * Diables TapGesture OF BOTH IMAGES. * **/ private void DisableImageTapping() { PlayImageScript play = PlayImage.GetComponent <PlayImageScript>(); play.DisableTapGesture(); PauseImageScript pause = PauseImage.GetComponent <PauseImageScript>(); pause.DisableTapGesture(); }