Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by wilhoran11 · Aug 11, 2017 at 06:49 AM · c#androidunity 5popuphold

Hold to peek or peek and pop in android

I need help on how to hold to peek or peek and pop in Android by adding or editing this code.

using UnityEngine; using UnityEngine.UI; using System.Collections; using UnityEngine.SceneManagement;

public class moduleScript : MonoBehaviour {

 public Canvas PopUpModuleFlameTest;
 public Canvas PopUpModuleColoredSmokeBomb;
 public Canvas PopUpModuleSolidToSolid;
 public Canvas PopUpModuleSaltCrystal;
 public Canvas PopUpModuleSloppySlime;
 public Canvas PopUpModuleVolcanoExplosion;
 public Canvas PopUpModuleSoapyFroth;
 public Canvas PopUpModuleSwirledMilk;
 public Button startText;
 public Button exitText;
 public Button FlameTest;
 public Button ColoredSmokeBomb;
 public Button SolidToSolid;
 public Button SaltCrystals;
 public Button SloppySlime;
 public Button VolcanoExplosion;
 public Button SoapyFroth;
 public Button SwirledMilk;
 public Canvas HintCanvas;
 public Button QuestionMark;
 public Button Close;


 // Use this for initialization
 void Start()
 {
     PopUpModuleFlameTest = PopUpModuleFlameTest.GetComponent<Canvas>();
     PopUpModuleColoredSmokeBomb = PopUpModuleColoredSmokeBomb.GetComponent<Canvas>();
     PopUpModuleSolidToSolid = PopUpModuleSolidToSolid.GetComponent<Canvas>();
     PopUpModuleSaltCrystal = PopUpModuleSaltCrystal.GetComponent<Canvas>();
     PopUpModuleSloppySlime = PopUpModuleSloppySlime.GetComponent<Canvas>();
     PopUpModuleVolcanoExplosion = PopUpModuleVolcanoExplosion.GetComponent<Canvas>();
     PopUpModuleSoapyFroth = PopUpModuleSoapyFroth.GetComponent<Canvas>();
     PopUpModuleSwirledMilk = PopUpModuleSwirledMilk.GetComponent<Canvas>();
     FlameTest = FlameTest.GetComponent<Button>();
     ColoredSmokeBomb = ColoredSmokeBomb.GetComponent<Button>();
     SolidToSolid = SolidToSolid.GetComponent<Button>();
     SaltCrystals = SaltCrystals.GetComponent<Button>();
     SloppySlime = SloppySlime.GetComponent<Button>();
     VolcanoExplosion = VolcanoExplosion.GetComponent<Button>();
     SoapyFroth = SoapyFroth.GetComponent<Button>();
     SwirledMilk = SwirledMilk.GetComponent<Button>();
     HintCanvas = HintCanvas.GetComponent<Canvas>();
     QuestionMark = QuestionMark.GetComponent<Button>();
     Close = Close.GetComponent<Button>();

     PopUpModuleFlameTest.enabled = false;
     PopUpModuleColoredSmokeBomb.enabled = false;
     PopUpModuleSaltCrystal.enabled = false;
     PopUpModuleSolidToSolid.enabled = false;
     PopUpModuleSloppySlime.enabled = false;
     PopUpModuleVolcanoExplosion.enabled = false;
     PopUpModuleSoapyFroth.enabled = false;
     PopUpModuleSoapyFroth.enabled = false;
     PopUpModuleSwirledMilk.enabled = false;
     HintCanvas.enabled = false;

 }
   
 public void ExitPress()//this function will be used on our Exit button
 {
     PopUpModuleFlameTest.enabled = true; //enable the Quit menu when we click the Exit button
     PopUpModuleColoredSmokeBomb.enabled = true;
     PopUpModuleSolidToSolid.enabled = true;
     PopUpModuleSaltCrystal.enabled = true;
     PopUpModuleSloppySlime.enabled = true;
     PopUpModuleVolcanoExplosion.enabled = true;
     PopUpModuleSoapyFroth.enabled = true;
     PopUpModuleSwirledMilk.enabled = true;
     // startText.enabled = false; //then disable the Play and Exit buttons so they cannot be clicked
     // exitText.enabled = false;
     HintCanvas.enabled = true;

     Close.enabled = false;
     QuestionMark.enabled = false;
     FlameTest.enabled = false;
     ColoredSmokeBomb.enabled = false;
     SolidToSolid.enabled = false;
     SaltCrystals.enabled = false;
     SloppySlime.enabled = false;
     VolcanoExplosion.enabled = false;
     SoapyFroth.enabled = false;
     SwirledMilk.enabled = false;
 }
 public void HintPress()
 {
     HintCanvas.enabled = true;
     QuestionMark.enabled = true;
     Close.enabled = true;
     PopUpModuleFlameTest.enabled = false;
     PopUpModuleColoredSmokeBomb.enabled = false;
     PopUpModuleSolidToSolid.enabled = false;
     PopUpModuleSaltCrystal.enabled = false;
     PopUpModuleSloppySlime.enabled = false;
     PopUpModuleVolcanoExplosion.enabled = false;
     PopUpModuleSoapyFroth.enabled = false;
     PopUpModuleSwirledMilk.enabled = false;
  
     FlameTest.enabled = false;
     ColoredSmokeBomb.enabled = false;
     SolidToSolid.enabled = false;
     SaltCrystals.enabled = false;
     SloppySlime.enabled = false;
     VolcanoExplosion.enabled = false;
     SoapyFroth.enabled = false;
     SwirledMilk.enabled = false;
 }

 public void FlameTestPress()
 {
     PopUpModuleFlameTest.enabled = true;
     PopUpModuleColoredSmokeBomb.enabled = false;
     PopUpModuleSolidToSolid.enabled = false;
     PopUpModuleSaltCrystal.enabled = false;
     PopUpModuleSloppySlime.enabled = false;
     PopUpModuleVolcanoExplosion.enabled = false;
     PopUpModuleSoapyFroth.enabled = false;
     PopUpModuleSwirledMilk.enabled = false;
     // startText.enabled = false;
     //exitText.enabled = false;
     FlameTest.enabled = true;
     ColoredSmokeBomb.enabled = false;
     SolidToSolid.enabled = false;
     SaltCrystals.enabled = false;
     SloppySlime.enabled = false;
     VolcanoExplosion.enabled = false;
     SoapyFroth.enabled = false;
     SwirledMilk.enabled = false;
 }
 public void ColoredSmokeBombPress()
 {
     PopUpModuleFlameTest.enabled = false;
     PopUpModuleColoredSmokeBomb.enabled = true;
     PopUpModuleSolidToSolid.enabled = false;
     PopUpModuleSloppySlime.enabled = false;
     PopUpModuleVolcanoExplosion.enabled = false;
     PopUpModuleSoapyFroth.enabled = false;
     PopUpModuleSwirledMilk.enabled = false;
     FlameTest.enabled = false;
     ColoredSmokeBomb.enabled = true;
     SolidToSolid.enabled = false;
     SaltCrystals.enabled = false;
     SloppySlime.enabled = false;
     VolcanoExplosion.enabled = false;
     SoapyFroth.enabled = false;
     SwirledMilk.enabled = false;
 }
 public void SolidToSolidPress()
 {
     PopUpModuleFlameTest.enabled = false;
     PopUpModuleColoredSmokeBomb.enabled = false;
     PopUpModuleSolidToSolid.enabled = true;
     PopUpModuleSaltCrystal.enabled = false;
     PopUpModuleSloppySlime.enabled = false;
     PopUpModuleVolcanoExplosion.enabled = false;
     PopUpModuleSoapyFroth.enabled = false;
     PopUpModuleSwirledMilk.enabled = false;
     // startText.enabled = false;
     //exitText.enabled = false;
     FlameTest.enabled = false;
     ColoredSmokeBomb.enabled = false;
     SolidToSolid.enabled = true;
     SaltCrystals.enabled = false;
     SloppySlime.enabled = false;
     VolcanoExplosion.enabled = false;
     SoapyFroth.enabled = false;
     SwirledMilk.enabled = false;

 }
 public void SaltCrystalsPress()
 {
     PopUpModuleFlameTest.enabled = false;
     PopUpModuleColoredSmokeBomb.enabled = false;
     PopUpModuleSolidToSolid.enabled = false;
     PopUpModuleSaltCrystal.enabled = true;
     PopUpModuleSloppySlime.enabled = false;
     PopUpModuleVolcanoExplosion.enabled = false;
     PopUpModuleSoapyFroth.enabled = false;
     PopUpModuleSwirledMilk.enabled = false;
     FlameTest.enabled = false;
     ColoredSmokeBomb.enabled = false;
     SolidToSolid.enabled = false;
     SaltCrystals.enabled = true;
     SloppySlime.enabled = false;
     VolcanoExplosion.enabled = false;
     SoapyFroth.enabled = false;
     SwirledMilk.enabled = false;

 }
 public void SloppySlimePress()
 {
     PopUpModuleFlameTest.enabled = false;
     PopUpModuleColoredSmokeBomb.enabled = false;
     PopUpModuleSolidToSolid.enabled = false;
     PopUpModuleSaltCrystal.enabled = false;
     PopUpModuleSloppySlime.enabled = true;
     PopUpModuleVolcanoExplosion.enabled = false;
     PopUpModuleSoapyFroth.enabled = false;
     PopUpModuleSwirledMilk.enabled = false;
     FlameTest.enabled = false;
     ColoredSmokeBomb.enabled = false;
     SolidToSolid.enabled = false;
     SaltCrystals.enabled = false;
     SloppySlime.enabled = true;
     VolcanoExplosion.enabled = false;
     SoapyFroth.enabled = false;
     SwirledMilk.enabled = false;

 }
 public void VolcanoExplosionPress()
 {

     PopUpModuleFlameTest.enabled = false;
     PopUpModuleColoredSmokeBomb.enabled = false;
     PopUpModuleSolidToSolid.enabled = false;
     PopUpModuleSaltCrystal.enabled = false;
     PopUpModuleSloppySlime.enabled = false;
     PopUpModuleVolcanoExplosion.enabled = true;
     PopUpModuleSoapyFroth.enabled = false;
     PopUpModuleSwirledMilk.enabled = false;
     FlameTest.enabled = false;
     ColoredSmokeBomb.enabled = false;
     SolidToSolid.enabled = false;
     SaltCrystals.enabled = false;
     SloppySlime.enabled = false;
     VolcanoExplosion.enabled = true;
     SoapyFroth.enabled = false;
     SwirledMilk.enabled = false;

 }
 public void NoPress() //this function will be used for our "NO" button in our Quit Menu
 {
     PopUpModuleFlameTest.enabled = false; //we'll disable the quit menu, meaning it won't be visible anymore
     PopUpModuleColoredSmokeBomb.enabled = false;
     PopUpModuleSolidToSolid.enabled = false;
     PopUpModuleSaltCrystal.enabled = false;
     PopUpModuleSloppySlime.enabled = false;
     PopUpModuleVolcanoExplosion.enabled = false;
     PopUpModuleSoapyFroth.enabled = false;
     PopUpModuleSwirledMilk.enabled = false;
     // startText.enabled = true;//enable the Play and Exit buttons again so they can be clicked
     //exitText.enabled = true;
     HintCanvas.enabled = false;

     QuestionMark.enabled = true;
     Close.enabled = true;

     FlameTest.enabled = true;
     ColoredSmokeBomb.enabled = true;
     SolidToSolid.enabled = true;
     SaltCrystals.enabled = true;
     SloppySlime.enabled = true;
     VolcanoExplosion.enabled = true;
     SoapyFroth.enabled = true;
     SwirledMilk.enabled = true;
 }
 public void SoapyFrothPress()
 {
     PopUpModuleFlameTest.enabled = false;
     PopUpModuleColoredSmokeBomb.enabled = false;
     PopUpModuleSolidToSolid.enabled = false;
     PopUpModuleSaltCrystal.enabled = false;
     PopUpModuleSloppySlime.enabled = false;
     PopUpModuleVolcanoExplosion.enabled = false;
     PopUpModuleSoapyFroth.enabled = true;
     PopUpModuleSwirledMilk.enabled = false;
     FlameTest.enabled = false;
     ColoredSmokeBomb.enabled = false;
     SolidToSolid.enabled = false;
     SaltCrystals.enabled = false;
     SloppySlime.enabled = false;
     VolcanoExplosion.enabled = false;
     SoapyFroth.enabled = true;
     SwirledMilk.enabled = false;
         
 }
 public void SwirledMilkPress()
 {
     PopUpModuleFlameTest.enabled = false;
     PopUpModuleColoredSmokeBomb.enabled = false;
     PopUpModuleSolidToSolid.enabled = false;
     PopUpModuleSaltCrystal.enabled = false;
     PopUpModuleSloppySlime.enabled = false;
     PopUpModuleVolcanoExplosion.enabled = false;
     PopUpModuleSoapyFroth.enabled = false;
     PopUpModuleSwirledMilk.enabled = true;
     FlameTest.enabled = false;
     ColoredSmokeBomb.enabled = false;
     SolidToSolid.enabled = false;
     SaltCrystals.enabled = false;
     SloppySlime.enabled = false;
     VolcanoExplosion.enabled = false;
     SoapyFroth.enabled = false;
     SwirledMilk.enabled = true;
 }
 public void StartFlameTest() //this function will be used on our Play button
 {
     SceneManager.LoadScene(2);  //this will load our first level from our build settings. "2" is the second scene in our game
 }
 public void StartColoredSmokeBomb()
 {
     SceneManager.LoadScene(3);
 }
 public void StartSolidToSolid()
 {
     SceneManager.LoadScene(4);
 }
 public void StartSaltCrystal()
 {
     SceneManager.LoadScene(5);
 }
 public void StartSloppySlime()
 {
     SceneManager.LoadScene(6);
 }

/ public void StartVolcanoExplosion() { SceneManager.LoadScene(7); }/ /public void StartSoapyFroth() { SceneManager.LoadScene(8); }/ }

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
â–¼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

462 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can not load the next scene 0 Answers

Someone please help me with combination lock 0 Answers

How to load android activity when the button clicked in unity scene? 0 Answers

I have a few questions 1 Answer

Android persistentdatapath Can be read but not written. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges