/** * * Enables both the image and TapGesture of that image. * Result: Image will show and will detect touch. * * String s is the iamge type you're trying to enable. * **/ private void EnableImage(string s) { if (s == "pause") { PauseImageScript pis = PauseImage.GetComponent <PauseImageScript>(); // Disable the tap gesture to prevent double touches. pis.EnableTapGesture(); // Disable image itself. PauseImage.GetComponent <Image>().enabled = true; } else if (s == "play") { PlayImageScript pis = PlayImage.GetComponent <PlayImageScript>(); // Disable the tap gesture to prevent double touches. pis.EnableTapGesture(); // Disable image itself. PlayImage.GetComponent <Image>().enabled = true; } else { } }
/** * * Enables TapGesture OF BOTH IMAGES. * **/ private void EnableImageTapping() { PlayImageScript play = PlayImage.GetComponent <PlayImageScript>(); play.EnableTapGesture(); PauseImageScript pause = PauseImage.GetComponent <PauseImageScript>(); pause.EnableTapGesture(); }