Search Unity

[RELEASED] Score Flash: Easy to use GUI for Scores, PowerUps, Achievements, Tutorials

Discussion in 'Assets and Asset Store' started by jashan, Sep 26, 2012.

  1. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I don't have PlayMaker, yet, but I've just scheduled adding playmaker actions for ScoreFlash V2.2 ;-) ... sounds like a nice addition, thank you for the request!
     
  2. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    No problem - I thought the error message was obvious but now I know it was not. So I have added a button right there in the custom inspector that links directly to the documentation which in turn links to a YouTube tutorial where I explain how to work with GUISkins, custom styles and fonts.
     
  3. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Thank you for the pointer - I very much appreciate it! Probably I won't include additional libraries, though, to keep things as simple as possible.
     
  4. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    You could of course use just those 3 files (2 classes + 1 interface): there are totally independent of a framework (just copy my MIT attribution over).

    The last use-case I have it on signals is communication between in-game objects and my editor windows :)

    This class is handy because it is the minimalistic subscribe/unsubscribe type of event dispatching system - very fast because it doesn't instantiate Event or EventArgs objects but passes all the values as params. Of course, the receiver (Slot) should know what type of data to expect from a certain Signal ;)
     
    Last edited: Oct 14, 2012
  5. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash V2 has been submitted to the Asset Store for approval - so most likely it will go online shorty (and the price for the package including all source code will go up from $15 to $30).

    New features in V2.0.0:

    • WARNING: may contain breaking changes - be sure to backup your project before upgrading! When accessing instance variables via ScoreFlash.Instance, you might have to typecast ((ScoreFlash)ScoreFlash.Instance) because I'm now using a clean interface for ScoreFlash
    • added IScoreFlash interface which is implemented by ScoreFlash - for a clean set of methods when accessing ScoreFlash (this mainly helps with Intellisense); ScoreFlash.Instance and ScoreFlashManager.Get(string name) return IScoreFlash but you can cast this to ScoreFlash if you really have to (not recommended!)
    • added new base class for custom "renderers": ScoreFlashRendererBase, so you can now use UnityGUI, GUIText (not too useful because it doesn't support scaling and rotating), or even NGUI and EZ GUI (adaptors will come with V2.1) to render the messages which makes ScoreFlash a "one draw-call solution" if you own these tools; the same approach will later be used to support the new Unity GUI system - whenever that becomes available ;-)
    • made ScoreFlash much more robust, covering lots of corner cases (most of which are resulting from the added flexibility ScoreFlash now has, like using custom renderers) … if you manage to generate an error that I haven't covered post to the forum (see Help / narayana games ;-) )
    • added ScoreFlashManager - the best way to work with multiple instances of ScoreFlash: Simply use ScoreFlashManager.Get(string name) to access any named instance of ScoreFlash
    • each instance of ScoreFlash now supports multiple message queues; this is important if, for instance, you use ScoreFlash for scores above game objects - when using ScoreFlashFollow3D, this just works and ScoreFlash makes sure that messages that belong to different game objects don't interact with each other; if you don't use ScoreFlashFollow3D for 3D positions, it's up to you to make sure things don't get messed up (you can use object.GetInstanceID() and pass it into PushLocal)
    • added utility class Easing - the easing methods from Util are still there but obsolete
    • Made persisting of changes during play much more robust (now supports changes in multiple objects during one session), and much more transparent (now has "store changes immediately" mode, and a new "click button to restore changes from play mode", the latter includes a button to fix all items of one type that were changed with a single button click); this is now used both for ScoreFlash as well as the new ScoreFlashFollow3DEditor … and can be added very easily to your own custom inspectors if you need it, using PlayModeChangesHelper
    • You can now enter any custom or existing style; this is useful if you want to use multiple instances of ScoreFlash with just a single GUISkin
    • added new methods to Util (under common): Util.IsPortrait (simple check for portrait based on Screen.width / Screen.height) and Util.ScaleInverse(…) which simply inverts what Util.Scale(…) does
     
  6. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash V2 is now available on the Asset Store!

    Buy ScoreFlash V2 on the Unity Asset Store!

    Please let me know how upgrading from V1 to V2 works for you. It should work without a problem for most people - but if you were accessing properties through ScoreFlash.Instance.someProperty, you'll have to change this to ((ScoreFlash)Instance).someProperty because ScoreFlash.Instance now returns ScoreFlash as its interface IScoreFlash.

    The nice thing about this change is that Intellisense no longer gives you all the MonoBehaviour "stuff" and properties which you really don't want there most of the time (I just ran into it myself because I'm "hacking" the properties a lot for the demos ;-) ).
     
  7. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I've added a tutorial that explains how to make sure your play mode changes in ScoreFlash-components don't get lost:

     
  8. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    V2.1.1 has been submitted to the Asset Store for approval and should be available very soon:

    • Added custom renderer for NGUI - if you have NGUI, you can now use ScoreFlash with a single draw call!
    • Added TestMode to ScoreFlashFollow3D
    • Added direct font assignment (as alternative to using GUISkins)
    • Added selection of "rendering": UnityGUI-GUISkin, UnityGUI-Font, CustomRenderer
    • Fixed a few warnings in Unity 4 (oops :-/ )
    • added proper documentation with examples to PlayModeChangesHelper
    • fixed comparing lists (this failed for list of colors resulting in PlayModeChangesHelper always thinking there was a change in all ScoreFlash instances even when there really was no change)
    • PlayModeChangesHelper now prints a nice list of changes (diff) to the console
    • PlayModeChangesHelper wasn't as reliable in 3.5.6 as in 3.4.2 - fixed ;-)


    And a little video showing you how easy it is to go from using ScoreFlash with UnityGUI (the default) to having ScoreFlash use NGUI instead:

     
  9. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash V2.1.1 (with NGUI support) is now available on the Asset Store! :)
     
  10. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I am getting these critical errors with V2.1.1:

    Assets/Editor/NarayanaGames/Common/PlayModeChangesHelper.cs(377,38): error CS0117: `Util' does not contain a definition for `AreEqual'
    Assets/Editor/NarayanaGames/Common/PlayModeChangesHelper.cs(385,34): error CS0117: `Util' does not contain a definition for `ToReadableDiff'
     
  11. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Hi Jashan!,

    That NGUI thing is killing!!! Awesome man! just what i needed!

    Now let's submit an update to apple :)

    Cheers,

    Roy
     
  12. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Angel,

    I'm sorry to hear you're having trouble with the upgrade. Most likely, the Util.cs file wasn't updated, so the first thing I would try is simply re-importing the whole package. I'll check for some more details but that's the first thing I'd try.

    I'm sorry this reply is coming a little late! Usually, I get immediate notifications from this forum thread but the message just reached me about 45 minutes ago and I was out. I'll be online on Skype for about one more our, so you can also reach me via jashanchittesh on Skype ;-)


    EDIT (more information):

    So, the first thing your error message tells me is that while PlayModeChangesHelper.cs was obviously upgraded (this is a new class in V2.1.1), as mentioned before, for some reason, Plugins/NarayanaGames/Common/Util.cs was not updated. There are several possible reasons for that: Maybe the package got corrupted during download. In that case, I recommend re-downloading the package. Here's a screenshot of how that's done (that's on the Asset Store, when you go to Score Flash V2):

    $AssetStoreRedownloadAndImport.png

    So, when you click on the little "down arrow" on the right part of the import button, you get that menu; then do "Redownload and Import" and that should fix any potential file corruptions in the package downloaded from the asset store.


    Also, please make sure to never uncheck any of the files when importing. In case you deleted something or unchecked a file, you can always re-import everything, so it's not a big deal; but if you miss updating one file, you will most likely get compilation errors because the new files cannot work with the old files (which seems to be what's happening for you for some reason).

    So, for instance, when I go from V2.0.0 (a package from my local drive) to V2.1.1 (from the Asset Store), I get this (I'm using the default (light) skin because I think it's a little easier to read on screenshots ... and not everyone can use the "Dark" skin):

    $AssetStoreImportingPackage.png
     
    Last edited: Oct 19, 2012
  13. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Roy,

    That's awesome to hear!!! :) I did notice one problem with the current implementation, though: if you do scaling, there can be a bit of jittering in the messages. This is fixed in the next version. Basically, instead of directly scaling the transform of the UILabel (which I did in the current prefab), you need to have a simple parent game object to which you attach the ScoreFlashRendererNGUI ... below that, you need the UILabel (without a ScoreFlashRendererNGUI - but if you have it there, it wouldn't hurt ;-) ).

    Then, instead of doing GetComponent<UILabel>() you need to do GetComponentInChildren<UILabel>() ... and that should cover it already.
     
  14. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I have reimported the whole package several times but the errors persist. Also importing to a new project the errors don't dissapear.
     
  15. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Ah, ok - so when you re-import to a new project, and the errors don't disappear, it's pretty much certain that the package you downloaded from the Asset Store got corrupted. See the first screenshot in the posting above. Hopefully, when you "Redownload and import" into a new project, all should compile fine. If that works, you should be safe re-importing to your existing project.

    I'm very sorry to hear about the troubles you're having! If it really is a corrupted package (which seems to be the case), then it's an issue with the asset store. Unless I'm getting a different version of V2.1.1 from the Asset Store than you are, the package is fine.

    Oh, just to make sure: Which version of Unity are you using? I have 3.4.2, 3.5.6 and Unity 4 beta and I'm using all of these for testing ScoreFlash (I did miss some warnings that occur in Unity 4 in the last version - but those are harmless and will no longer appear in the next release). I did my recent "upgrade experiments" with 3.5.6 but if you're on another version that I also have, I'm happy to try it with that one as well, just to be sure it's not related to the Unity version.
     
  16. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Just a quick update on this issue: We've tried several things (including what I've posted above) but it seems there's no way to get the package working on Angel's machine ... which is extremely weird (even after redownload and import).

    When I install the package, it always works without any issues (and I've tried it on several different machines now).

    Is anyone else having issues with V2.1.1?
     
  17. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I am pretty sure my problem is (for any strange reason) Unity fails to compile the new scripts on my machine (the compilation is not completed).
    I use Unity Pro 3.5.6f4 on Windows 7 64 bits.

    Thanks for your support.
     
    Last edited: Oct 20, 2012
  18. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I have just submitted V2.2.0 to the Asset Store, here's a list of upcoming features:

    • Now supporting PlayMaker!!!
    • Added support for EZ GUI … but … consider this "experimental" for now!
    • Added component menus for ScoreFlash, ScoreFlashManager and ScoreFlashFollow3D
    • Polished documentation quite a bit; ScoreFlash class now has quite a few examples right in the class description
    • Added new methods PushLocal(string text, Color color) etc. to send messages in a specific color
    • Removed "Disable Outlines" section when using a custom renderer (it has no effect in that case)
    • Fixed some jittering problems that could occur when using NGUI for rendering: in particular, changed the prefab to have a parent game object with a child UILabel (should have done it this way right from the start!); make sure to also update your NGUI packages if you are using ScoreFlash with NGUI!
    • Added ScoreFlashFollow3D.keepStatic to not follow the messages but use the configuration options
    • added new method FreezeLocation(float timeSeconds) to ScoreFlashFollow3D
    • Made Util.AreEqual(…) methods more robust (these threw exceptions when null-references were passed)
    • ScoreFlashManager "Copy Name" is now called "Copy Ref" and puts ScoreFlashManager.Get("TheName") to the copy buffer which makes this much more useful ;-)
    • Fixed a bug where clicking "Show Message" in the test section in the ScoreFlash inspector would go to the wrong ScoreFlash instance
    • ScoreFlashManager now also has "ensureSingleton", which defaults to true (like ScoreFlash)
     
  19. helioxfilm

    helioxfilm

    Joined:
    Apr 23, 2008
    Posts:
    259
    NGUI and Playmaker support warmly welcomed. Glad I bought it at v1 :)
     
  20. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Score Flash V2.2.0 has been approved and is now available on the asset store. So, you can now use PlayMaker, NGUI and EZ GUI (EZ GUI support is currently "experimental") with ScoreFlash.

    Please be aware that I'll be on vacation starting tomorrow (Wednesday, October 24th) until Wednesday, November 14th. So, during this time I may be a little slow answering any questions that come up. If there's anything urgent, make sure to contact me via eMail (you can use Unity's help menu / narayana games / "Report a problem" to find out contact information), and I'll do my best to get you up to speed again.
     
  21. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash V2.2.2 is now available: This is a minor refactoring: Util is now called NGUtil, and Easing is now called NGEasing. This fixes problems that could occur when using ScoreFlash together with other packages (e.g. MegaFiers). After upgrading to V2.2.2, please delete the files Easing.cs and Util.cs as well as the folder "Deprecated". They are no longer needed. You may have to replace any references to Easing or Util in your own code with NGEasing and NGUtil (obviously, the ScoreFlash code already uses NGEasing and NGUtil ;-) ).

    Also, I've added extensive written documentation in PDF format - check it out and let me know what you think and if you feel there's still anything missing:

     
  22. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Btw, if you like ScoreFlash - I very much appreciate ratings and reviews!!! At the moment, it still says "Not enough ratings".

    And of course, if you find anything you're not totally happy with - please let me know! The feedback I received so far really helped me improve ScoreFlash, so that's greatly appreciated!!!
     
  23. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Back from vacation - so any question will be answered again quickly (unless forum notifications fail on me ;-) ). And a few little polishings and the DLL version are coming up soon :)
     
  24. iwishash1

    iwishash1

    Joined:
    Jul 8, 2012
    Posts:
    11
    Hi
    I'm using ScoreFlash with NGUI.
    Thank you for well made documentation. It's pretty easy to follow.

    By the way, can I use sprite instead of label?
    Sometimes I need sprite image animating action like label in ScoreFlash.
     
  25. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Thank you - that's great to hear!!!

    I believe this should be possible - but either you or I might still have to implement a little extension.

    So, basically what you'd need to have is that instead of some text, you'd have some image, right?

    The main limitation you'd run into most likely is that the API currently is designed to only take text as parameter for what should be displayed. But one thing you could do is define a couple of "codes" that map to specific sprites / images. Like "alert" might then show up as some exclamation mark.

    Do you think that would work for you?
     
  26. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307

    Heads Up!

    X-Mas Sale coming up (probably tomorrow, 2012-12-18)!
    So while I really want you to buy ScoreFlash - wait until it's 30% off!!!​

    => Sale has started - get it NOW!!!
     
    Last edited: Dec 18, 2012
  27. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash V2.2.4 is now available (this is a minor bugfix release which fixes an issue with the PlayMaker actions; when you use PlayMaker, make sure to re-import Plugins/NarayanaGames/ScoreFlash/Component/PlayMaker-Actions-Package after you have updated ScoreFlash to 2.2.4!
     
  28. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash is on Sale - 30% off!!!

    Get it NOW for $20 instead of $30!!!
     
  29. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
  30. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    I just bought this and it's awesome, just what I needed! I've also left a review on the asset store.

    I do however have a little issue. I'm using it with NGUI Playmaker and have followed your instructions but I can get my text in the centre of the screen. I've set it to TopLeft as well as many other positions and still not in the centre. It's perhaps something i'm missing. Any ideas?


    Edit: It seems to be as a result of unchecking the Automatic box on the NGUI UIRoot component.
     
    Last edited: Dec 21, 2012
  31. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Thank you for the feedback review - that's very much appreciated, and I'm glad this serves your needs well!!!

    Regarding your little issue: Where exactly does the text appear for you?

    The first thing that comes to mind is the screen alignment, which is set in the inspector of ScoreFlash / Main Layout / Screen Align. Most likely, you have already set this to Middle (it's also the default) - but just to be totally sure nothing gets missed.

    Are you using the prefab that came with the NGUI integration (NGUI-ScoreFlash / ScoreFlashRendererNGUI)?

    That prefab has just the ScoreFlashRendererNGUI component at its root, and an UILabel (coming from NGUI) right below it. If you have a weird offset, one possible reason could be that for some reason, when you've created your own prefab, the component doing the actual rendering is offset from the root object. In other words, taking the default prefab example as reference: If the UILabel below ScoreFlashRendererNGUI had a local translation (i.e. position != (0,0,0) ), that would result in messages being rendered with that offset.

    The pivot on that UILabel needs to be "Center".

    And finally: You need UI Root / Camera / Anchor in your scene with Anchor having "Side = TopLeft". And your ScoreFlash instance rendering the messages needs to have Main Layout / Custom Parent for Renderer Instances set to that Anchor (in the example scenes, that anchor has the name "Anchor-TopLeft-ForScoreFlash" to make it very obvious.

    While in play mode, you can check if the Renderers go below the correct parent when messages are being shown.

    I know this is a bit of a broad answer but hopefully, the relevant information is included. If now, please let me know.
     
  32. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Thank you for the update - I didn't think of that ... but yeah, when this is unchecked, the positioning of the messages immediately breaks. So I guess I need to provide a little readme for the NGUI-integration.
     
  33. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    No problem, I should really be keeping the box checked anyway. :)
     
  34. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    That x-mas sale went pretty well - but it was only 13 days (if it ends as it was announced), so I've decided to extend it until the end of January. I just have to hit the moment when the Hot Deals end before I'll be manually reducing the price back from $30 to $20 (plus tax). In other words: If the Asset Store Madness / Hot Deals have ended and I don't have the new price but up - wait a few hours until that's fixed (unless, of course, you want to get ScoreFlash at its original price which is still a fair deal ;-)
     
  35. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Are there any ScoreFlash customers that rely on 3.4.2 support? I'm currently preparing the next version of ScoreFlash and was wondering if that's still really necessary. I also have a poll on how much interest there is in 3.4.2 support (in general; like: how many people are actually still using 3.4.2), so feel free to either discuss this here or there.
     
  36. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    The "extended sale" is now online ... so, you still have time to get ScoreFlash with 33% off until end of January 2013!
     
  37. dashesy

    dashesy

    Joined:
    Dec 20, 2012
    Posts:
    3
    Ok I just purchased it. This is my very first game and I just have a rough idea about what I want to do, wish me luck
     
  38. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Good luck ... and have fun!!! :)

    Let me know if there's any way I can assist you with using ScoreFlash - and when you have your first demo ready, feel free to post a link in this thread!
     
  39. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Two more weeks for the "Extended Sale" ... so you might want to get your copy of ScoreFlash right now ;-)

    And a little heads up: Unity 3.4.2 support will be removed with the next release, so the next version of ScoreFlash will have a minimum requirement of Unity 3.5.7. Let me know in case that's a problem for you and I'll look into finding a solution!
     
  40. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    This is a big problem for me. I just want to know if score flash can message words at the same time while the words have different colors? What I mean is something like "This is Awesome!" and all 3 words in that sentence can be given different colors. I'm looking to buy either way but this would be a bonus.
     
  41. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash does support this in principle - but it depends also on which version of Unity you're using, or if you are using add-ons for rendering (like NGUI).

    If you are using Unity 4, you can set Rich Text in the GUI Style in the GUISkin you are using. Then you can use all the features supported by Unity's Rich Text Feature. As far as I know, this was added for Unity 4, so this doesn't work in Unity 3.x. It may work with GUIText or TextMesh in earlier versions of Unity but GUIText doesn't work that great (there's an example custom renderer that uses GUIText) and I haven't tried using ScoreFlash with TextMesh, yet. It's possible - but it might be complex to set up.

    Anyways, with Unity 4, it's very very easy. Here's a screenshot of a test I just did:

    $ScoreFlashMultipleColors.png

    The text I used for testing this is (in a single line):

    Code (csharp):
    1. <color=#FF0000FF>TEST</color>
    2. <color=#00FF00FF>TEST</color>
    3. <color=#0000FFFF>TEST</color>
    4. <color=#FFFFFF33>ALPHA</color>
    One nice thing is that ScoreFlash automatically multiplies the colors with its built-in color fading. So, you can do all kinds of strange things, if you wish (but don't get confused if you're not getting exactly the colors you're setting in the Rich Text ;-) ).

    Or, as I did in this example - to prevent confusion - you can select Colors / Color Selection Mode = UseColorFromSkin. That way, you only fade the alpha values in ScoreFlash and the actual colors from the GUISkin / Rich Text are used exactly as they are. Be careful: If you type <color#FFFFFF00> you will not see your message because it's totally transparent ;-)

    For Rich Text to work in UnityGUI, as mentioned before, you need Unity 4, and you need to set up the GUISkin correctly, as the following screenshot illustrates (of course, you need to make sure that you're editing the GUISkin and GUIStyle you're using in your specific instance of ScoreFlash - for details, see the tutorial: ScoreFlash - GUISkins, GUIStyles and Fonts):

    $GuiSkinSetup.png


    NGUI and EZ GUI (I believe) have similar features, so if you are using any of these, it should also work.

    I have just tested it with NGUI. It also works - only the syntax is a little different, as described in NGUI: Label (NGUI Documentation). So, when using NGUI, you could use, for example, a text like:

    Code (csharp):
    1. [00FF00] some Green Text [FF0000] Some Red Text
    Let me know how this works for you!
     
  42. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Yes, I am currently using Unity 4 with EZGUI. Thanks for the response.

    Are there any tutorials on how to use this with EZGUI or is it straightforward?
     
    Last edited: Jan 22, 2013
  43. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    It should be straightforward - but if there's anything you run into that is giving you trouble, please let me know.

    If you already have EZ GUI in your project, and you've added ScoreFlash, simply double click Plugins / NarayanaGames / ScoreFlash / CustomRendering / ScoreFlashRendererEZGUI-Package (path in your project). That imports a package that will add a new folder EZ GUI-ScoreFlash to your project (and that requires to have EZ GUI in project).

    This folder includes one very simple example (Example1-EZGUI), and a more advanced example (Example2-EZGUI), as well as two prefabs (GUICamera and ScoreFlashRendererEZGUI) that should help you get started.

    Regarding the set up of your ScoreFlash instance, the important thing is to have Main Layout / Rendering set to CustomRenderer, and then pull the prefab ScoreFlashRendererEZGUI into the slot ScoreFlash Renderer. The prefab uses EZScreenPlacement - so if you're familiar with that, it should be pretty straightforward ;-)

    I just checked how coloring text works with EZ GUI ... it's a little different from NGUI but also works just fine, here's an example that you could use in ScoreFlash:

    Code (csharp):
    1. [#FF0000] Red [#00FF00] Green [#FF000033] Red Transparent
     
    Last edited: Jan 22, 2013
  44. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Thanks. I don't use playmaker though. I have uScript so hopefully reflection works for this.

    Bought!
     
  45. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    So I imported scoreflash ezgui, opened the example scenes and a lot of errors are firing:

    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. ScoreFlashRendererEZGUI.GetSize (NarayanaGames.ScoreFlashComponent.ScoreMessage msg) (at Assets/EZ GUI-ScoreFlash/ScoreFlashRendererEZGUI.cs:57)
    3. ScoreFlash.PushLocal (System.String text, Nullable`1 color, UnityEngine.GUIStyle style, UnityEngine.GUIStyle styleHighDensity, Int32 messageQueueID) (at Assets/Plugins/NarayanaGames/ScoreFlash/ScoreFlash.cs:1363)
    4. ScoreFlash.PushLocal (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUIStyle styleHighDensity, Int32 messageQueueID) (at Assets/Plugins/NarayanaGames/ScoreFlash/ScoreFlash.cs:1272)
    5. ScoreFlash.PushWorld (.ScoreFlashFollow3D follow3D, System.String text, UnityEngine.GUIStyle style, UnityEngine.GUIStyle styleHighDensity) (at Assets/Plugins/NarayanaGames/ScoreFlash/ScoreFlash.cs:1194)
    6. ScoreFlash.PushWorld (.ScoreFlashFollow3D follow3D, System.String text, UnityEngine.GUIStyle style) (at Assets/Plugins/NarayanaGames/ScoreFlash/ScoreFlash.cs:1181)
    7. ScoreFlash.PushWorld (.ScoreFlashFollow3D follow3D, System.String text) (at Assets/Plugins/NarayanaGames/ScoreFlash/ScoreFlash.cs:1150)
    8. WorldSpaceMessagesCSharp+<GenerateMessages>c__Iterator9.MoveNext () (at Assets/Xamples-ScoreFlash/Advanced/WorldSpaceMessagesCSharp.cs:62)
    9. UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    10. WorldSpaceMessagesCSharp:Start() (at Assets/Xamples-ScoreFlash/Advanced/WorldSpaceMessagesCSharp.cs:22)
    Code (csharp):
    1.  
    2. NullReferenceException: Object reference not set to an instance of an object
    3. ScoreFlashRendererEZGUI.Awake () (at Assets/EZ GUI-ScoreFlash/ScoreFlashRendererEZGUI.cs:32)
    4. UnityEngine.Object:Instantiate(Object)
    5. ScoreFlash:PushLocal(String, Nullable`1, GUIStyle, GUIStyle, Int32) (at Assets/Plugins/NarayanaGames/ScoreFlash/ScoreFlash.cs:1300)
    6. ScoreFlash:PushLocal(String, GUIStyle, GUIStyle, Int32) (at Assets/Plugins/NarayanaGames/ScoreFlash/ScoreFlash.cs:1272)
    7. ScoreFlash:PushWorld(ScoreFlashFollow3D, String, GUIStyle, GUIStyle) (at Assets/Plugins/NarayanaGames/ScoreFlash/ScoreFlash.cs:1194)
    8. ScoreFlash:PushWorld(ScoreFlashFollow3D, String, GUIStyle) (at Assets/Plugins/NarayanaGames/ScoreFlash/ScoreFlash.cs:1181)
    9. ScoreFlash:PushWorld(ScoreFlashFollow3D, String) (at Assets/Plugins/NarayanaGames/ScoreFlash/ScoreFlash.cs:1150)
    10. <GenerateMessages>c__Iterator9:MoveNext() (at Assets/Xamples-ScoreFlash/Advanced/WorldSpaceMessagesCSharp.cs:62)
    11. UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    12. WorldSpaceMessagesCSharp:Start() (at Assets/Xamples-ScoreFlash/Advanced/WorldSpaceMessagesCSharp.cs:22)
    And "Behavior is missing" on the Score flash renderer children.
     
  46. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    That does not look good. Especially when it happens in the example scenes. Just be sure: You do have EZ GUI imported into your project, right?

    That's my first guess ... I'm trying to reproduce this here and will keep you updated. One thing that seems very weird (that's why I'm asking about EZ GUI being imported): The NullReferenceException in the second error means that the SpriteText is missing on the prefab. This should never be the case.

    On the other hand: If you didn't have EZ GUI imported, you should be getting compile time errors ... btw: you can also contact me on Skype via jashanchittesh, if you wish.
     
  47. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hm ... I've tried hard to reproduce your issue - including importing everything from ScoreFlash first, and then EZ GUI. But it all looks perfect for me. I believe the key problem for you is in the last thing you said: "And Behavior is missing on the Score flash renderer children."

    It seems that for some reason, Unity doesn't connect the scripts from EZ GUI with the ScoreFlashRendererEZGUI prefab (and most likely also not with the GUICamera prefab, either). That also explains the NullReferenceExceptions.

    In general, Unity is pretty good with keeping references - as long as you're using their packages for importing stuff. But if for some reason, the internal ID Unity is having for the SpriteText script (and probably also EZScreenPlacement script) is different in your project than in mine, then Unity fails to recognize those references. That kind of sucks ;-)

    Probably the quickest way for you to get things running is simply dragging those scripts where they belong in the prefabs. I'm adding some screenshots to illustrate this:

    $WiringUpSpriteText.png

    $WiringUpEZScreenPlacement.png

    $WiringUpUIManager.png

    After that, it should work. Sorry for the inconvenience - that shouldn't be necessary :-(

    Does this work for you?
     
  48. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    I fixed the broken scripts by doing it from the main prefab like in your pics, instead of the ones in the scene. It works! Unity also auto fixes broken scripts now it seems. :)

    Also the shader used for the GUI was blank. What shader was used?

    Thanks!
     
  49. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Great to hear this fixed it for you. Regarding the shader, I'm not perfectly sure I know which one you mean - but I'll try anyways ;-)

    The shader used by ScoreFlashRendererEZGUI on Material Eraser62 is "Sprite / Vertex Colored, Fast". Wow, I'm surprised that Unity even failed on recognizing that one :-(

    Was that the shader you were looking for? Does that work for you?
     
  50. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I'm quoting this from the old thread to keep all support questions and answers together in on the thread:

    Thank you for reporting that issue! I'm currently investigating it further, setting up a test project that hopefully reproduces the issue and then fix it (or let you know how you can fix it). Here's the information I have already:

    That message ("Restored ScoreFlash.Instance - most likely you did a recompile while playing, all is good, no worries ;-)") is actually just a little info that ScoreFlash has lost its internal instance references and automagically restored it. This certainly shouldn't cause a crash on iOS because it means "there was a problem but I successfully fixed it".

    There's also an error that you would get if that operation failed. That error would start with "Trying to access ScoreFlash.Instance but there is no gameobject with ScoreFlash attached in the scene!" (and then elaborates on what exactly you did wrong and how you can fix it ... it's kind of a long message ;-) ).