Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by m123al · Mar 11, 2014 at 05:37 PM · guiiosnativeu3dxt

U3DXT basic Dialog box Question

I just bought the u3dxt plugin and want to display a simple dialog box with a "OK" and "Cancel" buttons. this makes that happen
GUIXT.ShowAlert ("Title", "Body", "OK", new string[] { "Cancel" });

but how to do i know what button was pressed?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by u3dxt · Mar 11, 2014 at 05:51 PM

Hi, you can subscribe to GUIXT.AlertDismissed event (http://u3dxt.com/api/?topic=html/E_U3DXT_iOS_GUI_GUIXT_AlertDismissed.htm). The example in Assets/U3DXT/Examples/core/GUIBasics has code on how to use it.

Comment
Add comment · Show 1 · Share
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
avatar image m123al · Mar 11, 2014 at 07:19 PM 0
Share

alright thanks

avatar image
0

Answer by m123al · Mar 12, 2014 at 01:40 AM

i have another question about AlertDissmised. If i have two dialog boxes and a ok button for both how would i check which "OK" was clicked?

Comment
Add comment · Show 3 · Share
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
avatar image u3dxt · Mar 12, 2014 at 01:45 AM 0
Share

In iOS, it only displays one alert at a time. Although you can call it a second time before the first one is dismissed, but you should design your app to avoid this.

avatar image m123al · Mar 12, 2014 at 01:48 AM 0
Share

right but i meant, say if i have an if statement where it says

if (e.selectedButtonTitle == "Ok") { DoSomething(); }

how would i know which popup the "Ok" it came from

avatar image u3dxt · Mar 12, 2014 at 01:55 AM 0
Share

Got your question.

You can do it like this:

 void Alert1() {
   GUIXT.AlertDismissed += Callback1; // subscribe it
   GUIXT.ShowAlert("alert1", ...);
 }
 
 void Callback1(object sender, AlertViewDismissedEventArgs e) {
   GUIXT.AlertDismissed -= Callback1; // unsubscribe it
   if (e.selectedButtonTitle == "O$$anonymous$$")
     ...
 }
 
 void Alert2() {
   GUIXT.AlertDismissed += Callback2; // subscribe it
   GUIXT.ShowAlert("alert2", ...);
 }
 
 void Callback2(object sender, AlertViewDismissedEventArgs e) {
   GUIXT.AlertDismissed -= Callback2; //unsubscribe it
   if (e.selectedButtonTitle == "O$$anonymous$$")
     ...
 }

You can make it more compact but this shows the concept. Hope this helps.

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

21 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

Related Questions

How to get local currency u3dxt 1 Answer

Native GUI-Style on IOS 2 Answers

Store/Stack Items 0 Answers

UnitySendMessage does and doesn't recognize receiver in 2 similar instances 0 Answers

Access Native Video files from Unity on Android / iOS 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