Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

show instrution image only once

Discussion in 'Scripting' started by Deleted User, Aug 25, 2017.

  1. Deleted User

    Deleted User

    Guest

    hi,
    i have a ui image which is instruction at beginning of game.
    this image has a simple 2d drag animation and is disabled after some seconds.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class ShowHelpDisabled : MonoBehaviour
    5. {
    6.  
    7.     public GameObject objectToDisable;
    8.     public GameObject objectToDisable02;
    9.  
    10.     private void Start()
    11.     {
    12.         StartCoroutine(ActivationRoutine());
    13.     }
    14.  
    15.     private IEnumerator ActivationRoutine()
    16.     {      
    17.         yield return new WaitForSeconds(6);
    18.  
    19.         objectToDisable.SetActive(false);
    20.         objectToDisable02.SetActive (false);
    21.     }
    22. }
    23.  

    i need it to be disabled the next time player start to load scene and play the game.please help me.thanks.
     
  2. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Use PlayerPrefs to set a flag on the first start. Query flag on subsequent starts.
     
  3. Deleted User

    Deleted User

    Guest

    i did , but where do you mean by subsequent starts?
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class ShowHelpDisabled : MonoBehaviour
    5. {
    6.     private int showhelp;
    7.  
    8.     public GameObject objectToDisable;
    9.     public GameObject objectToDisable02;
    10.  
    11.     private void Start()
    12.     {
    13.         showhelp = ShowHelpDisabled.showhelp;
    14.         int showhelp = PlayerPrefs.GetInt ("showhelp");
    15.         int showhelp = PlayerPrefs.SetInt ("showhelp");
    16.  
    17.  
    18.         StartCoroutine(ActivationRoutine());
    19.     }
    20.  
    21.     private IEnumerator ActivationRoutine()
    22.     {      
    23.         yield return new WaitForSeconds(6);
    24.  
    25.         objectToDisable.SetActive(false);
    26.         objectToDisable02.SetActive (false);
    27.     }
    28. }
     
  4. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Code (CSharp):
    1. if(PlayerPrefs.HasKey("key"))
    2. {
    3.     // Not the first start because pref exists
    4.     // Don't show help
    5. }
    6. else
    7. {
    8.     // First start because pref does not exist
    9.     // Create pref
    10.     PlayerPrefs.SetInt("key",0);
    11.     PlayerPrefs.Save();
    12.     // Show help
    13. }
     
  5. Deleted User

    Deleted User

    Guest

    does not work . i am beginner . please explain where to put code. thanks.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class ShowHelpDisabled : MonoBehaviour
    5. {
    6.     private int showhelp;
    7.  
    8.     public GameObject objectToDisable;
    9.     public GameObject objectToDisable02;
    10.  
    11.     private void Start()
    12.     {
    13.  
    14.         StartCoroutine(ActivationRoutine());
    15.  
    16.         if(PlayerPrefs.HasKey("showhelp"))
    17.         {
    18.             // Not the first start because pref exists
    19.             // Don't show help
    20.         }
    21.         else
    22.         {
    23.             // First start because pref does not exist
    24.             // Create pref
    25.             PlayerPrefs.SetInt("showhelp",0);
    26.             // Show help
    27.         }
    28.     }
    29.  
    30.     private IEnumerator ActivationRoutine()
    31.     {      
    32.         yield return new WaitForSeconds(6);
    33.  
    34.         objectToDisable.SetActive(false);
    35.         objectToDisable02.SetActive (false);
    36.         PlayerPrefs.SetInt ("showhelp",0);
    37.  
    38.     }
    39. }
    40.  
     
  6. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    My snippet was an example and is not going to do anything on its own. You need to use just a little bit of initiative here. The comments should tell you all you need to know.
     
    rahulk1991 likes this.
  7. Deleted User

    Deleted User

    Guest

    on which method your snippet should be placed?
     
  8. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    You're almost there but you're still calling your activation routine each time - which you don't want to do. My comments tell you when to call it.
     
    rahulk1991 likes this.
  9. Deleted User

    Deleted User

    Guest

    i have there coroutine , what do you mean by show help? it means : PlayerPrefs.SetInt("key",0);
    ???

    and dont show help??? strange!
     
  10. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Ok, sorry I misread your code. My code snippet is showing you how to use PlayerPrefs to set/query a flag in order to decide what to do. You could disable your objects in Awake and then only activate them the first time, i.e. when the pref does not exist, before disabling again 6 seconds later. After the first time, when the pref does exist, you do nothing because the objects have already been disabled in Awake.
     
  11. Deleted User

    Deleted User

    Guest

    exactly i wanted to say that. here with DisableRoutine , after 6 seconds two gameobjects are disabled.

    now with help of your snippet and pointing to awake method , will you by code language clarify it alittle so that i follow the way? thanks.

    P.S : i changed ActivationRoutine to DisableRoutine so that it is better understood.
     
  12. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Code (CSharp):
    1. void Awake()
    2. {
    3.     // Disable objects here
    4. }
    5.  
    6. void Start()
    7. {
    8.         if(PlayerPrefs.HasKey("showhelp"))
    9.         {
    10.             // Not the first time because pref already exists
    11.             // Do nothing here
    12.         }
    13.         else
    14.         {
    15.             // First time because pref does not exist
    16.             // Create pref
    17.             PlayerPrefs.SetInt("showhelp",0);
    18.             // Call coroutine here
    19.         }
    20. }
    21.  
    22. IEnumerator MyCoroutine()
    23. {
    24.     // Enable objects here
    25.  
    26.     // Wait for 6 seconds here
    27.  
    28.     // Disable objects here
    29. }
    30.  
     
  13. Deleted User

    Deleted User

    Guest

    with no error , it does not work!
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class ShowHelpDisabled : MonoBehaviour
    5. {
    6.     private int showhelp;
    7.  
    8.     public GameObject objectToDisable01;
    9.     public GameObject objectToDisable02;
    10.  
    11.     void Awake()
    12.     {
    13.         objectToDisable01.SetActive(false);
    14.         objectToDisable02.SetActive (false);
    15.     }
    16.  
    17.      void Start()
    18.     {
    19.         if(PlayerPrefs.HasKey("showhelp"))
    20.         {
    21.             // Not the first time because pref already exists
    22.             // Do nothing here
    23.         }
    24.         else
    25.         {
    26.             // First time because pref does not exist
    27.             // Create pref
    28.             PlayerPrefs.SetInt("showhelp",0);
    29.             StartCoroutine(DisableRoutine());      
    30.         }
    31.     }
    32.  
    33.      IEnumerator DisableRoutine()
    34.     {    
    35.         objectToDisable01.SetActive(true);
    36.         objectToDisable02.SetActive (true);
    37.         yield return new WaitForSeconds(2);
    38.         objectToDisable01.SetActive(false);
    39.         objectToDisable02.SetActive (false);
    40.  
    41.     }
    42. }
    43.  
    44.  
    what is wrong?
     
  14. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    You don't say what is wrong but I would assume that the problem is because the pref already exists from earlier. Try a different key name or delete the pref.
     
  15. Deleted User

    Deleted User

    Guest

    yes . in another script i use playerpref but with different key like score . also in your code there is no getint ...
    one question : private int showhelp; is an int, right? but why key is string?
     
  16. Deleted User

    Deleted User

    Guest

    look , this is all :
    there is a gameobject with a script attachd to. inside script there is startcoroutine and disables the gameobject after 2 seconds.
    now the queston is how to see this gameobject only one time and next time scene is loaded, that gameobject does not show up?
     
  17. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    In my example I'm just using the existence of the pref as a flag. It doesn't have to be an int and can be any supported type because I don't care what the value is. All I care about is whether it exists or not. Key is always a string - see the docs.
     
  18. Deleted User

    Deleted User

    Guest

    i dont know what to do.
     
  19. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    It's not clear what you're actually trying to achieve but if you want the same thing to happen each time your game runs then you don't even need prefs, you just need a flag that gets set on the first time. Probably easiest is a static bool in your script.

    Code (CSharp):
    1. static bool flag = false;
    2.  
    3. void Awake()
    4. {
    5.     // Disable objects here
    6. }
    7. void Start()
    8. {
    9.         if(!flag)
    10.         {
    11.             flag = true;
    12.             // Call coroutine here
    13.         }
    14. }
    15. IEnumerator MyCoroutine()
    16. {
    17.     // Enable objects here
    18.     // Wait for 6 seconds here
    19.     // Disable objects here
    20. }
    21.  
     
  20. Deleted User

    Deleted User

    Guest

    what i am trying to achieve is to disable forever a gameobject in my game after it is showed only one time , no more i need it to be showed. only one time as a help image. this gameobject has a coroutine to stay in scene for 2 seconds.
     
  21. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Does forever mean only until the game is next launched or really forever?
     
  22. Deleted User

    Deleted User

    Guest

    i mean rezlly forever.
    next time game is launched also i dont need it to be there , because player has one learnt how to play the game. thanks,
     
  23. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Then use player prefs as I showed you. If it doesn't work then debug it to determine why it doesn't work.
     
  24. Deleted User

    Deleted User

    Guest

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class ShowHelpDisabled : MonoBehaviour
    5. {
    6.     static bool flag = false;
    7.     public GameObject objectToDisable01;
    8.     public GameObject objectToDisable02;
    9.  
    10.      void Start()
    11.     {
    12.         if(!flag)
    13.         {
    14.             flag = true;
    15.  
    16.             StartCoroutine (DisableRoutine ());
    17.         }
    18.     }
    19.  
    20.      IEnumerator DisableRoutine()
    21.     {    
    22.         objectToDisable01.SetActive(true);
    23.         objectToDisable02.SetActive (true);
    24.         yield return new WaitForSeconds(2);
    25.         objectToDisable01.SetActive(false);
    26.         objectToDisable02.SetActive (false);
    27.  
    28.     }
    29. }
    code above disables image after 2 seconds , but next time also image is shown. i dont really know how correctly use
    playerpref.setint and getint and haskey commands in which methods . many youtubed still its hard to understand.
     
  25. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    What does 'next time' mean? Next time the game is started? Next time the scene is loaded during the same game?

    If you don't deactivate them then they will obviously be shown.

    If you want to store persistent state between game sessions then you need something like player prefs.

    SetInt sets a value with a specific key.
    GetInt gets a value with a specific key.
    HasKey checks to see if any value exists with a specific key.

    The values are store on the game's local file system so that they persist between game sessions. Once you call SetInt then that value will exist on the game's file system until you either change it or delete it (or uninstall the game).
     
    rahulk1991 and (deleted member) like this.
  26. Deleted User

    Deleted User

    Guest

    yes , these descriptions are all everywhere, thank you , but in practice, on project tell me for game sessions mode, how those playerprefs commands would be used to make sense if you will, we are talking about it liong time and every time i tell you same request and you say more ..please just use code instead of help language helping. thanksssssssssssssssss lol my friend .
     
  27. Errorsatz

    Errorsatz

    Joined:
    Aug 8, 2012
    Posts:
    555
    This forum is for getting help to learn/use Unity, not for having people just write the scripts for you. Besides, you're going to have to learn this stuff to write most other scripts as well, so unless your game is 100% complete except for the help screen, just getting the script for that won't solve your issues.
     
  28. Deleted User

    Deleted User

    Guest

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class ShowHelpui : MonoBehaviour
    5. {
    6.  
    7.     void Start ()
    8.     {
    9.         StartCoroutine (DisableHelpui ());
    10.     }
    11.    
    12.     IEnumerator DisableHelpui ()
    13.     {
    14.         yield return new WaitForSeconds (4.8f);
    15.         this.gameObject.SetActive (false);
    16.     }
    17. }
    this code only shows image every time scene is loaded . how to make it showing only one time?
    any help?
    i dont know how to set and get playerprefs values in order to shut down image after first time it is shown. thanks,
     
    augment-it likes this.
  29. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    Ok sorry, this is ridiculous.

    You're receiving replies in a thread all the time and still PM people at the same time just to get yet another similar reply.

    Please don't do this, it's neither efficient for you nor great for the ones that are kind enough to help. I'm not going to reply in PMs anymore.

    Here's the way I'd have get you started, but you said it's too complex (it's just copy&paste btw) so I'll post it for anyone else who might search a very basic idea how to approach that.

    Code (CSharp):
    1. private const byte REQUIRED = 1;
    2. private const byte NOT_REQUIRED = 0;
    3. private const string PP_KEY_INTRO_REQUIRED = "IntroRequired";
    4.  
    5. private void Start()
    6. {
    7.     if (IsIntroductionRequired)
    8.     {
    9.         IsIntroductionRequired = false;
    10.  
    11.         // trigger introduction / tutorial etc.
    12.     }
    13.  
    14.     // other initialization steps
    15. }
    16.  
    17. private bool IsIntroductionRequired
    18. {
    19.     get { return PlayerPrefs.GetInt(PP_KEY_INTRO_REQUIRED, REQUIRED) == REQUIRED; }
    20.     set { PlayerPrefs.SetInt(PP_KEY_INTRO_REQUIRED, value ? REQUIRED : NOT_REQUIRED); }
    21. }
     
    hasburg and (deleted member) like this.
  30. Deleted User

    Deleted User

    Guest

    i used your code and it does not operate correctly , may you please clarify more here?
     
  31. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    What do you mean by 'it does not operate correctly' ?
    You have to be more specific. Where did you put it? Do you get any errors? Is there any unexpected result?
     
    Deleted User likes this.
  32. Deleted User

    Deleted User

    Guest

    no , i mean it works! the values were wrong entered by me , but now it works.

    btw do you know how can i direct from my android game to my instagram profile page? thanks.
     
  33. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    How was that even possible? I pre-defined the values :p

    As for the other request, try to use Application.OpenURL.
    Your app needs the permission to use the device's internet, so you have to enable the capability which grants access to internet. You can either do that in the manifest file or by checking the box in the player settings.
     
    Deleted User likes this.
  34. Deleted User

    Deleted User

    Guest

    yesterday i showed your codes to a master student and he helped more at hrz. ok but about now, i like to follow manifest file modification to get links to my game insta, twitter and facebook . but please explain in more details , because every world you say is a complex definitions of work . i am new to programming .
    so i know where is located manifest in unity project on computer hard disk , ok . now after opening that and using Application.OpenURL. how shold be insta link wirtten? thanks.
     
  35. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    If you're that new to programming, you might be better off doing some tutorials about the basics first.

    The way you're currently approaching this may be fun, as you sooner or later get results you'd like to have. But it's indeed the wrong way to learn programming if you're being serious about it, at least for the majority.

    The reason is that you'll most-likey don't learn the fundamental concepts, you miss alot of things that you'll be wondering about for a long time in the future until you finally grasp that specific yet trivial concept that you should have known days, weeks or months ago already. You could miss alot of ooprtunities to apply the concept, instead you'd search for it on the internet or even wait for answers in a forum.
    Or you do things in a much more inconvenient or even inefficient way, wheras it could have been sooo much easier.

    So at the moment, you only try to learn the usage of the API for a certain problem/domain.
    Sure, if you're smart and/or do it long enough, you could extract usage patterns and infer general syntax and programming rule-sets by just doing that. But that's honestly the wrong way, it's much more efficient to be patient, take some time to read the basics and then delve into more and more details. That's usually the way how you can transfer and apply knowledge, find alternative ways to achieve something.

    After all, programming is so much more than just typing in some letters that make sense.
    It's continuous research about things you want to know about or need to know about, that's pretty easy nowadays as most of the stuff you may need is already somewhere on the internet - multiple times, in different variations and with lots of additional details that may be relevant or even just interesting.
     
    rahulk1991 and (deleted member) like this.
  36. Deleted User

    Deleted User

    Guest

    Allright!!!!!
    you know people good, so now i am trying to
    Code (CSharp):
    1. <manifest
    2.  
    3.     xmlns:android="http://schemas.android.com/apk/res/android"
    4.     package="com.rosegames.thecyclist"
    5.     android:versionName="1.0"
    6.     android:versionCode="1"
    7.     android:installLocation="preferExternal">
    8.  
    9.   <supports-screens
    10.       android:smallScreens="true"
    11.       android:normalScreens="true"
    12.       android:largeScreens="true"
    13.       android:xlargeScreens="true"
    14.       android:anyDensity="true" />
    15.  
    16.   <application
    17.       android:theme="@style/UnityThemeSelector"
    18.       android:icon="@drawable/app_icon"
    19.       android:label="@string/app_name"
    20.       android:debuggable="false"
    21.       android:isGame="true">
    22.  
    23.     <activity
    24.         android:name="com.unity3d.player.UnityPlayerActivity"
    25.         android:label="@string/app_name"
    26.         android:screenOrientation="landscape"
    27.         android:launchMode="singleTask"
    28.         android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
    29.  
    30.       <intent-filter>
    31.  
    i dont know where to use instagram//user?username
    or even by your suggest use application.openur
     
    Last edited by a moderator: Aug 29, 2017
  37. Deleted User

    Deleted User

    Guest

    so i found these codes :
    Code (CSharp):
    1. <uses-permission android:name="android.permission.INTERNET"/>
    2. <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    how from these lines in manifest can man direct to his , her instagram profile page?thanks.
     
  38. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    As i said ealier, you can do it in the Player Settings (Unity Editor). It's less error prone and just a simple check box.

    All you do there is granting access to the internet for your app (which the user may get a pop-up for in order to accet/decline, that's handled by the OS). Once you've done that, you can place a button somewhere which uses Application.OpenURL on click to open your public profile page.

    If you specificly want to open the corresponding app instead of the browser, you'll probably need to do some more research or wait for other people to reply, as I cannot help with that.

    You don't need to put anything related to the social platform or your account into the manifest file, it just handles capabilities and other information about the app for the specific OS. I'd recommend to not change it manually or touch it at all if you don't know what you're doing.
     
  39. Deleted User

    Deleted User

    Guest

    very good , since my unity version is ...5.3.6.1 its like a auto / require . Then now it is set to require rather than default auto choice. ok?
    and i have button already there in shop scene of my game. now jus please tell me how to use app visit not browser one.

    what is complete phrase for instagram link ? its like below?
    Application.OpenURL("instagram?username");
     
  40. Deleted User

    Deleted User

    Guest

    how can you open instagram profile page from unity in app not in browser?

    i used Application.Openurl() , but it will run browser. any help?thanks,
     
    Last edited by a moderator: Aug 29, 2017
  41. Errorsatz

    Errorsatz

    Joined:
    Aug 8, 2012
    Posts:
    555
    rahulk1991 and (deleted member) like this.
  42. Deleted User

    Deleted User

    Guest

    thanks. That thing is not free , but about other java code , how should i use that code? i made a new class and copied them there , and now its hard to understand where to say my target is instagram app to be launched after player touched ui button. any explaination ? thanks.
     
  43. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    Why is it so important?
    I'd just show the name, if people are interested and not too lazy they'd just look it up themselves.
     
    Deleted User likes this.
  44. Deleted User

    Deleted User

    Guest

    allright , if i am not in wrong direction, Suddoha, do you mean without using any facebook, twitter...sdk , just using application.openurl, would be enough?oder?

    P.S : but you know, i like my game looks professional. if it uses app visit....
     
  45. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    I'd say that doesn't make your game much more professional, it's a tiny detail that may (or may not) be convenient for some people.
    Some might even think it's a bit too much. That's pretty much a thing for UX and probably requires proper feedback and some research.

    As I said, I'd decently give the hint that you're present on social platforms as well. Such as an 'About' menu that you can often find in games/apps/websites.
     
    Deleted User likes this.
  46. Deleted User

    Deleted User

    Guest

    it is not important anymore. application.openurl is good to go there. here is another question.
    my game score is saved with
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.UI;
    4.  
    5. public class Playerscore : MonoBehaviour
    6. {
    7.    
    8.     private int score;
    9.     public Text coinText;
    10.  
    11.     void Start()
    12.     {
    13.         score = GlobalValues.money;
    14.         coinText.text = "" + score.ToString();
    15.     }
    16.  
    17.     void OnTriggerEnter2D(Collider2D col)
    18.     {
    19.         if (col.gameObject.tag == "Coin")
    20.         {  
    21.             GlobalValues.money = GlobalValues.money + 1;
    22.             GetComponent<persistentData>().Save();
    23.             score++;
    24.             coinText.text = "" + score.ToString();
    25.             col.gameObject.SetActive (false);
    26.  
    27.         }
    28.     }
    29.  
    30. }
    31.  
    there in globalvalues there are getint and then in persistent data there is save and load.
    i have a button in my game shop that i need by click on that 1000 coins add to game . how should i do it because i get errors
    null exception/...
     
  47. Deleted User

    Deleted User

    Guest

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. CoinExtraAdding.addbtnone () (at Assets/Scripts/CoinExtraAdding.cs:19)
    3. UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:153)
    4. UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:630)
    5. UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:765)
    6. UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:53)
    7. UnityEngine.UI.Button.Press () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:35)
    8. UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:44)
    9. UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:52)
    10. UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269)
    11. UnityEngine.EventSystems.EventSystem:Update()
    12.  
    i mean score is added by each time clicking on ui button but that error shows up also in console.
    i have a ui text which already has a script attached to. its parent also has another script because it shows a panel.
    and now i have an empty gameobject with this code that need to say increase coins.
     
  48. Deleted User

    Deleted User

    Guest

    Suddoha , its alittle complex your explainnations. what does mean in this talk really "About" component of game? while the second question is always about some solution to give direct app launch. And now third about score adding . can you explain more that we understand you ? thanks, please use easy code language also.
     
  49. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    These lines are of interest.

    Read from bottom to top:
    - Exception happened during execution of an UnityEvent (apparently your button's onclick).
    - It's calling into CoinExtraAdding.addbtnone()

    That's the last function on the stack in which the error occurs. Take the line number and check your code there.
     
    Deleted User likes this.
  50. Deleted User

    Deleted User

    Guest

    Code (CSharp):
    1.         GlobalValues.money = GlobalValues.money + 1;
    2.  
    that is correct. this line is there. and what problem it provides?