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.

Coherent UI - HTML5-based User Interface middleware

Discussion in 'Assets and Asset Store' started by stoyannk, Oct 30, 2012.

  1. Mr-Brent

    Mr-Brent

    Joined:
    Aug 20, 2013
    Posts:
    19
    Is there a responsiveness difference between the different ways to call JS from Unity? I've been using the ExecuteScript command, just for ease of implementation: ie "ExecuteScript('hud.setRadialSelect(4);');" etc. so I can skip binding on that direction, however I'm noticing a slight 50-100ms lag on the ui. Is there sometime I can do to speed that up? Will doing the straight bindings be faster, or is there just an inherent lag in between the two systems that I need to account for?

    Also, is there a more appropriate place to ask questions of you guys? I didn't see a support section on the Coherent site. Thankfully y'all check here, but I just wanted to make sure I'm in the right spot.
     
  2. AnchoV

    AnchoV

    Joined:
    Jun 5, 2013
    Posts:
    17
    Hi,

    Your idea looks really intriguing and we are behind it 100%. We already voted for it and wish you good luck with this initiative.

    Cheers,
     
  3. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    Hello,

    Is it possible to use <video> tags?
    Trying to do so but i don't know if I am supposed to do something special or not.

    * Have tried mp4 and mkv still no video, getting the message "Could not recognize the mime type...." and tried to find info on what mime types are supported, but could not find any info. :S
     
    Last edited: Oct 4, 2013
  4. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    Hi,

    The Support portal is still being prepared, but you can email us at support@coherent-labs.com.

    It is unlikely that the lag is caused by the way of calling to JS. What is the target framerate of your view?
    Is your project vsynced? If it is not and it is quite heavy on the GPU then Coherent UI might be starved of GPU time and run at very low framerate?
    Enabling On-Demand for the view and setting the target framerate to 60 should reduce the lag.
    You can check the framerate of the view using the Debugger. Click on the cog icon in the bottom left and then - Show FPS counter.
    Another variant is this event to trigger some massive relayout/repainting in the view. You can track this using the Timeline tab of the Debugger.

    As I said, if you need to ask us or send a sample project to us, contact support@coherent-labs.com
     
  5. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    Hi, the ffmpeg that we distribute with Coherent UI plays only patent-free codecs like Ogg Theora.
    I'll try to make a complete list and share it you.
     
  6. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    Thank you DimitarT!
    I have a question regarding loading a scene that has a Coherent UI view attached to the camera. Is there supposed to be a slight latency/lag before the view launches?

    For me my ui shows after maybe around 500ms after the scene has loaded.

    Got the ogg video working, I have a "intro" scene where the scene consist of only a camera that has a coherentui view script that is pointing to the intro.html file(below to see the content of the html file)
    Code (csharp):
    1.  
    2. <!DOCTYPE HTML>
    3. <html>
    4. <head>
    5.     <title>intro</title>
    6.     <!-- css -->
    7.     <link rel="stylesheet" type="text/css" href="sharedResource/css/main.css" media="screen" />
    8.    
    9.    
    10.     <!-- js -->
    11.     <script src="sharedResource/js/coherent.js"></script>
    12.     <script src="sharedResource/js/jquery-2.0.3.min.js"></script>
    13.     <script src="sharedResource/js/jquery.hammer.min.js"></script>
    14. </head>
    15. <body>
    16.     <div id="allWrap">
    17.         <video id="introVideo" width="100%" height="100%" autoplay>
    18.             <source src="sharedResource/video/iphone/LogoAnim.ogg" type="video/ogg">
    19.         </video>
    20.         <div id="skipIntro"></div>     
    21.     </div> 
    22. <script>
    23.     // Tell Unity3D to load mainMenu level
    24.     document.getElementById('introVideo').addEventListener('ended',FireCallFunc,false);
    25.     function FireCallFunc(e) {
    26.         if(!e) { e = window.event; }
    27.         engine.call('LoadMainMenu');
    28.     }          
    29.    
    30.     // Tell Unity3D to skip intro *load mainMenu level
    31.     $("#skipIntro").hammer().on('touch', function () {
    32.         engine.call('LoadMainMenu');
    33.     });        
    34. </script>      
    35. </body>
    36. </html>
    37.  
    The ogg video file is about 4.35 mb. When I press the unity's play button the scene runs and after about ~500ms the html file is loaded into the coherent ui view and then after about 3-4 secs the video starts playing. Everything is inside the UIresources folder nothing is being run from the web so my question is how do I get rid of the waiting times.
     
    Last edited: Oct 5, 2013
  7. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    I have an event triggering every frame to send the Async level load progress to my UI, but once it finally finishes and loads the level it causes the below to be throw to the console.

    Code (csharp):
    1.  
    2. [Coherent UI] (AssertFailure) Assert failure: Dispatching a message to a non-active view  0 at UISystemImpl.cpp : 1390
    3. UnityEngine.Debug:Log(Object)
    4. Coherent.UI.UnityLogHandler:WriteLog(Severity, String, UInt32) (at Assets/Standard Assets/Scripts/CoherentUI/Detail/LogHandler.cs:19)
    5. Coherent.UI.ILogHandler:SwigDirectorWriteLog(Int32, String, UInt32) (at /Users/coherent/Desktop/PandoStatic/Pando/Coherent/UI/DotNET/swig/ILogHandler.cs:67)
    6. Coherent.UI.CoherentUI_NativePINVOKE:UISystem_Update(HandleRef)
    7. Coherent.UI.UISystem:Update() (at /Users/coherent/Desktop/PandoStatic/Pando/Coherent/UI/DotNET/swig/UISystem.cs:50)
    8. CoherentUISystem:Update() (at Assets/Standard Assets/Scripts/CoherentUI/CoherentUISystem.cs:714)
    9.  
    Any idea how to stop this? I've added to all my code to cancel the sending of information if view component is null and if view.View is null so if there is no view it shouldn't do anything. I guess what's happening is the event is sent, but then in the same frame the level is loaded, then the next frame the event is trying to complete? Any idea how to debug exactly what's doing this? Is this something I can safely ignore?

    I also get the below occasionally.

    Code (csharp):
    1.  
    2. [Coherent UI] (Error) 0Trying to get a non-active view 4
    3. UnityEngine.Debug:Log(Object)
    4. Coherent.UI.UnityLogHandler:WriteLog(Severity, String, UInt32) (at Assets/Standard Assets/Scripts/CoherentUI/Detail/LogHandler.cs:19)
    5. Coherent.UI.ILogHandler:SwigDirectorWriteLog(Int32, String, UInt32) (at /Users/coherent/Desktop/PandoStatic/Pando/Coherent/UI/DotNET/swig/ILogHandler.cs:67)
    6. Coherent.UI.CoherentUI_NativePINVOKE:UISystem_Update(HandleRef)
    7. Coherent.UI.UISystem:Update() (at /Users/coherent/Desktop/PandoStatic/Pando/Coherent/UI/DotNET/swig/UISystem.cs:50)
    8. CoherentUISystem:Update() (at Assets/Standard Assets/Scripts/CoherentUI/CoherentUISystem.cs:714)
    9.  
    There also seams to be some weird issue when going from full screen to windowed then back to full screen. It causes my entire UI to black out and I'm not sure how to get it to come back. Any idea of how this could be happening?

    All this is probably my fault and I mainly just need a way to track down those messages. I need to know what's trying to call the view that doesn't exist. At least the name of the function, delegate, class, something.

    Edit: Ok, it looks like it's due to BindCall trying to handle its Return when the view is being disposed of during level load. How do I stop the delegate or stop the view from doing anything in this case? What I do for now is if the view is null or view.View is null I just return null, but that doesn't stop it from attempting to process the return value. I want to just kill its usage entirely in this case. Am I going to have to check every frame if the view is still available? I hope not o_O

    Edit: Ok, it's purely due to LoadLevelAsync. If I use LoadLevel it doesn't throw messages, but I want to use LoadLevelAsync because I want a loading screen.

    Edit: Fixed LoadLevelAsync issue! You need to set view.enabled = false; before the level loading completes. So delay it, when progress hits 0.9f set the view as disabled then let it finish loading. This prevents the view from doing anything during the last moments of the level loading. The only problem with this is it causes the UI to flash disappear for a split second. I wish there was a better way of telling the UI "stop sending events dummy!" when loading a level. Suggestions?
     
    Last edited: Oct 6, 2013
  8. Mr-Brent

    Mr-Brent

    Joined:
    Aug 20, 2013
    Posts:
    19
    It's nothing for the GPU, my game runs at a constant 60 FPS, and when I try the UI in mobile safari is super fast, so that doesn't seem to be an issue.

    Does Coherent Mobile support On-Demand? It looks like the setting is behind a "Is coherent pro" type of block. It seems that and target framerate both aren't available.

    Update: Vsync doesn't seem to have made a difference. Neither did using TriggerEvent instead of ExecuteScript, like you said. It was worth trying though.

    Update 2: So I did some ping tests to see what the round trip is, and I actually had to have a lot of S*** going on to even get it to 10ms in the editor with the remote. On the ipad itself, it barely scratches 1ms. So.... something else is wrong. I will keep poking.

    Update 3: So due to a bug, it was redrawing 8 different multistep gradients every update. It works fine now, sorry for the confusion!
     
    Last edited: Oct 7, 2013
  9. gridside

    gridside

    Joined:
    Jul 26, 2013
    Posts:
    97
    Hi Coherent Team,

    I sent you two emails (one to info@, other to support@) last week. But i don't get reply from you. Can you please check your mailbox? Please let me know if my mails are not delivered to you. So i can re-send.

    Best.
     
  10. Darkoo

    Darkoo

    Joined:
    Feb 4, 2013
    Posts:
    96
    Some errors that I get:
    Code (csharp):
    1.  
    2. Assets/scripts/CoherentGuiCalls.js(118,41): BCE0017: The best overload for the method 'Coherent.UI.View.TriggerEvent(String)' is not compatible with the argument list '(String, String)'.
    3.  
    Code (csharp):
    1.  
    2. Assets/scripts/CoherentGuiCalls.js(126,41): BCE0017: The best overload for the method 'Coherent.UI.View.TriggerEvent(String)' is not compatible with the argument list '(String, int)'.
    3.  
    And this one is after updating to the latest version on Asset Store:
    Code (csharp):
    1.  
    2. OutOfMemoryException: Out of memory
    3. Coherent.UI.ViewListenerBase.GetHeaders (intptr) (at /Users/coherent/Desktop/PandoStatic/Pando/Coherent/UI/DotNET/swig/ViewListenerBase.cs:43)
    4. Coherent.UI.BrowserViewListener.SwigDirectorOnFinishLoad (int,string,bool,int,intptr) (at /Users/coherent/Desktop/PandoStatic/Pando/Coherent/UI/DotNET/swig/BrowserViewListener.cs:374)
    5. (wrapper native-to-managed) Coherent.UI.BrowserViewListener.SwigDirectorOnFinishLoad (int,intptr,int,int,intptr) <IL 0x00036, 0x0010a>
    6. Coherent.UI.UISystem.Update () (at /Users/coherent/Desktop/PandoStatic/Pando/Coherent/UI/DotNET/swig/UISystem.cs:50)
    7. CoherentUISystem.Update () (at Assets/Standard Assets/Scripts/CoherentUI/CoherentUISystem.cs:714)
    8.  

    *FIX
    Changing this:
    Code (csharp):
    1.  
    2. #if UNITY_EDITOR || COHERENT_UNITY_STANDALONE
    3. import Coherent.UI.Binding;
    4. import Coherent.UI;
    5. #elif UNITY_IPHONE || UNITY_ANDROID
    6. import Coherent.UI.Mobile.Binding;
    7. import Coherent.UI.Mobile;
    8. #endif
    9.  
    To this, fixed both two first errors:

    Code (csharp):
    1.  
    2. #if UNITY_STANDALONE || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_EDITOR
    3. import Coherent.UI.Binding;
    4. import Coherent.UI;
    5. #elif UNITY_IPHONE || UNITY_ANDROID
    6. import Coherent.UI.Mobile.Binding;
    7. import Coherent.UI.Mobile;
    8. #endif
    9.  
    The third error: I tried to re-install a couple of times without any luck of getting the error disappear, lastly I removed everything coherent and then re-installed and the error was gone.
     
    Last edited: Oct 8, 2013
  11. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    I'm still not sure how to address this issue either. If you go from full screen to windowed then back to full screen or vise verse it causes the UI to completely black out. Should I reload or redraw the UI anytime the resolution is changed?


    Any feedback regarding this? If this is the best solution will just continue using it, but it'd be nice to be able to tell the UI to stop sending/receiving events. This way I can basically pause the event system during level loading as there's a period during Async level loading that it has issues trying to communicate with a UI that doesn't exist anymore.
     
  12. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    You guys are normally more responsive then this. Could you please address my above post? It's basically halted my project at this point. Especially the fullscreen-windowed-fullscreen black out bug. I can't have players toggling their screen size and not being able to play anymore.
     
  13. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    Hi,

    Unfortunately there isn't much you can do to reduce the time for initializing Coherent UI and loading the video later.
    You can show a loading screen however.
    The best option is to start the CoherentUIView disabled and showing a loading screen in Unity3D.
    When the video is ready to play, you can tell Unity3D to remove the loading screen and show the view.
    This will remove even the 500ms for loading the view.
    Alternatively you can implement the loading screen in Coherent UI. In order to minimize the initial loading time
    try to minimize the amount of resources for that view. You can also minimize the roundtrips between
    Coherent UI and Unity3D for the resource loading using data URLs
    You can convert the entire source of the view to a data URL, load it in Unity3D as a string and tell Coherent UI to load it.

    Here is a an html page that shows a progress bar until there is enough data to play the entire video.
    Code (csharp):
    1.  
    2. <!DOCTYPE html>
    3. <html>
    4. <head>
    5.     <style>
    6.         .hidden { display: none };
    7.     </style>
    8. </head>
    9. <body>
    10. <div id="loading">
    11.     Loading<br/>
    12.     <progress></progress>
    13. </div>
    14. <div id="screen" class="hidden" style="width: 1280px; height: 720px">
    15. <video  width="1280" height="720" tabindex="0" id="video" preload="auto">
    16.     <source id="ogv" src="http://media.w3.org/2010/05/bunny/trailer.ogv" type="video/ogg">
    17. </video>
    18. </div>
    19. <script type="text/javascript">
    20.     function playVideo() {
    21.         document.getElementById('loading').classList.add('hidden');
    22.         document.getElementById('screen').classList.remove('hidden');
    23.         document.getElementById('video').play();
    24.         // signal Unity3D to show the view
    25.     }
    26.    
    27.     window.addEventListener('load', function() {
    28.         var video = document.getElementById('video');
    29.         video.videoWidth=1280;
    30.         video.videoHeight=720;
    31.         if (video.readyState == 4) {
    32.             playVideo();
    33.         } else {
    34.             video.addEventListener("canplaythrough", playVideo);
    35.         }      
    36.     });
    37. </script>
    38. </body>
    39. </html>
    40.  
     
  14. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    Hi,

    We are terribly sorry about the delay. We are using the notifications of the forum to send us emails about new posts, but sometimes
    it stops working.

    The event that generates the concrete "Dispatching a message to a non-active view" is CursorChanged, so you can safely ignore it.
    It is a synchronization issue between Unity3D and Coherent UI - Coherent UI generates and queues events for the view, but at the time of the update the view is already destroyed in Unity3D.
    There is no API at the moment to silence the view.
    We'll be addressing the synchronization issue in the future releases of Coherent UI.

    You can suppress the concrete issue (if you are not actually using the cursor events)
    by preventing cursor changes.
    Code (csharp):
    1.  
    2.     <style>
    3.         * { cursor: default }
    4.     </style>
    5.  
    About the fullscreen issue - we couldn't reproduce it. Can you send us a sample scene/project where this happens or,
    at least, give us some information about your setup - CoherentUIView settings, cameras, rendering path?

    Once again, I am sorry for the delay.
     
  15. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    Hi,

    I am terribly sorry for that.
    Can you tell me your email (in a private message if you prefer), so that we can track down what happened and why you didn't receive any answer.
     
  16. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    No worries, these forums can get a bit.. wonky lol.


    Ah, ok, thank you! I've implemented a workaround for the time being. What I do is completely shut off the UI at the last 10% of the level loading and it stops it from doing that, lol.


    I do use cursor changes so I won't be able to suppress it. My workaround seams to be ok for now though, thank you very much for letting me know the cause though.


    Strange, I wonder if it's due to my usage of jQuery dialogs for window centered menus instead of CoherentUI it self. I'll try to reproduce in a new project and see what happens.
     
  17. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    What is the effect of the going from fullscreen to window and back - does the entire view disappear or some part of it, or just stops working.
    I doubt that jQuery dialogs have anything to do with it, except any sizing issue in the html itself. If the view disappears it is probably some
    quirk in the rendering integration with Unity3D.
     
  18. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    The UI basically becomes invisible. My cursor changes still work so that makes me believe element mouseover behavior still works. It's very weird. So it's still working, but invisible lol.
     
  19. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Ok, I tried forcing the cursor to default on all elements, but I still got the below thrown to console on every Aysnc level load.

    Code (csharp):
    1.  
    2. [Coherent UI] (Error) 0Trying to get a non-active view 0
    3. UnityEngine.Debug:Log(Object)
    4. Coherent.UI.UnityLogHandler:WriteLog(Severity, String, UInt32) (at Assets/Standard Assets/Scripts/CoherentUI/Detail/LogHandler.cs:19)
    5. Coherent.UI.ILogHandler:SwigDirectorWriteLog(Int32, String, UInt32) (at /Users/coherent/Desktop/PandoStatic/Pando/Coherent/UI/DotNET/swig/ILogHandler.cs:67)
    6. Coherent.UI.CoherentUI_NativePINVOKE:UISystem_Update(HandleRef)
    7. Coherent.UI.UISystem:Update() (at /Users/coherent/Desktop/PandoStatic/Pando/Coherent/UI/DotNET/swig/UISystem.cs:50)
    8. CoherentUISystem:Update() (at Assets/Standard Assets/Scripts/CoherentUI/CoherentUISystem.cs:714)
    9.  
    Is this the same issue as the cursor change or something different? I do have code trying to send information to the view every frame. Maybe this is the issue?
     
  20. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    I will have to do some test to be completely sure, but I believe this error is caused by a race condition between the render thread and the main thread.
    Coherent UI uses the Unity3D native rendering plugin API which basically calls our function in the render thread when a specific view has to be rendered.
    This is done only after a request for rendering the view has been made in the main thread using GL.IssuePluginEvent.
    What happens is that the main thread an event for drawing the view is issued and the view is destroyed before the rendering thread has actually
    managed to call our callback and draw the view. Anyway our callback is eventually called and it generates the error.
    This also explains why disabling the view makes the error disappear - it stops being rendering before it is destroyed.

    You can safely ignore that error, while we consider how to better handle this race condition.
     
  21. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Ok, great. For now I've implemented a workaround to avoid my console blowing up with every scene change. Before setting allowSceneActivation back to true I disable the View and set the farClipPlane for the MainCamera to 0.2f (0.1f greater than close distance). This allows it to go to a blank black screen basically for a short period of time while the level completes. Really though all that CoherentUI needs is some sort of function maybe to shut off events entirely and it'll probably solve this as I could just shut off the events before finishing the level load.

    Still unsure about the fullscreen, windowed, fullscreen issue. I'll be looking into it tomorrow and either fixing or implementing some sort of workaround. There are no errors associated with this issue though, but again it could just be some sort of UI issue with my jQuery, don't know yet.
     
  22. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Ok, I tried redrawing the UI and reloading it. I still can't get the invisible UI issue solved. It only happens if I go from fullscreen to windowed to full screen and only if it's done in the Built copy of the game (no issues in editor).
     
  23. gridside

    gridside

    Joined:
    Jul 26, 2013
    Posts:
    97
    Hi Coherent Team;

    I'm using Coherent Standart and sometimes getting this error when i press play on unity;

    ApplicationException: UI System initialization failed!
    CoherentUISystem.Start () (at Assets/Standard Assets/Scripts/CoherentUI/CoherentUISystem.cs:558)


    Need to restart unity for Coherent take action. Is this a known bug?

    Best.
     
  24. Mr-Brent

    Mr-Brent

    Joined:
    Aug 20, 2013
    Posts:
    19
    I'm having some trouble maintaining the Coherent UI view across scenes. My camera prefab has a check to make sure it's the only camera, and if not, it kills itself. This all works, but Coherent throws the following error *sometimes*. I think it has to do with whether or not my camera check's Awake() was before Coherent's, but I have no idea how to ensure that.

    Code (csharp):
    1.  
    2. MissingReferenceException: The object of type 'CoherentUIView' has been destroyed but you are still trying to access it.
    3. Your script should either check if it is null or you should not destroy the object.
    4. CoherentUIView.OnSystemReady () (at Assets/Standard Assets/Scripts/CoherentUI/CoherentUIView.cs:738)
    5. CoherentUISystem.Update () (at Assets/Standard Assets/Scripts/CoherentUI/CoherentUISystem.cs:719)
    6.  
    Any ideas?

    True to form, I figured it out after posting.

    I made this change to CoherentUIView.cs on line 738
    Code (csharp):
    1.  
    2. if (this  this.enabled) //instead of just 'this.enabled'
    3.     {
    4.         SendCreateView();
    5.     }
    6.  
     
    Last edited: Oct 13, 2013
  25. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    Hi,

    Thanks for the extra info, we are going to check it out as soon as possible.
     
  26. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    Hi,

    This happens when you are editing the scripts while the game is running inside the editor.
    In this case Unity3D reloads its assemblies, but doesn't reload the native plugins
    leaving the managed and native parts out of synchronization.

    This is fixed in our latest release - 1.5.3. If we detect that Unity3D editor is reloading the game assemblies,
    we stop Coherent UI from running. That way you can restart your game without restarting the editor.

    This is far from perfect solution and we are still looking for a better way to ensure that the UI state (including
    the JavaScript state) is preserved upon reloading the game assemblies.
     
  27. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    Hi,

    We are going to investigate that.
     
  28. gridside

    gridside

    Joined:
    Jul 26, 2013
    Posts:
    97
    Thanks for the info DimitarT.
     
  29. strich

    strich

    Joined:
    Aug 14, 2012
    Posts:
    350
    Team, are you putting up release notes anywhere? We have no knowledge at all of when you release a new build nor what it actually fixes.
     
  30. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    The update fixed my previous problem but it seems that unity crashes whenever i have clickthrough checked, it also crashes whenever I touch a dropdown box.

    Cohernet version 1.5.2
    mac - os x version 10.6.8
    unity 3.5.5
     
  31. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Change log is under the developers section of their site. Below is direct link.

    http://coherent-labs.com/changelog/

    1.5.3 notes aren't on there yet, but they'll update it I'm sure.

    Also to CoherentUI team. I just wanted to take a moment to say thanks. Your support is absolutely wonderful and its been a pleasure using CoherentUI for my entire UI solution. It's awesome being able to work with the knowledge I already have (am a professional web developer) for my UI.
     
  32. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    Hi, it seems that the is a bug in our Mac OS X 10.6 support. We are currently working on that, so hopefully, it will be fixed in the next release.
     
  33. Holon777

    Holon777

    Joined:
    Sep 29, 2012
    Posts:
    28
    I'm getting these errors doing an android build and I'm left with a large 202mb apk file and the coui resources are not in it, it all works fine on iOS build, Unity 3.5.7 pro on Mac

    jarsigner: jarsigner: unable to open jar file: /Users/myusername/myApp/Assets/../Temp/CouiApkRepack/dist/myAppAndroid.apk

    /Developer/Android/sdk/tools/zipalign: Unable to open '/Users//myusername/myAppAssets/../Temp/CouiApkRepack/dist/myAppAndroid.apk' as zip archive
     
  34. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    Hi,

    I suspect that our packing procedure has failed to repack the apk. This procedure is
    responsible to remove the CoherentUI_Host files which are used only on desktop platforms as well as pack the uiresources folder inside
    the apk. Can you send us the Unity3D editor log from building the sample?

    You can replace the apktool that we are bundling with Coherent UI with the one from your Android SDK. Our apktool is in Assets\CoherentUI\Editor\apktool1.5.2 (please replace the files inside the apktool.1.5.2 directory).

    We are working on a fix for this issue.
     
  35. Holon777

    Holon777

    Joined:
    Sep 29, 2012
    Posts:
    28
    Changing out the apktool did not fix the issue, however going back to using the default uiresource directory as my coui directoy did fix the problem (i had changed it to guiresoiurce) and I have a normal size apk file with my coui folder inside the apk with my files. HOWEVER when the app runs I still get "the webpage at coui:://uiresources/test3.html" might be temporarily down...." when I bring up the view. Please help!
     
  36. Holon777

    Holon777

    Joined:
    Sep 29, 2012
    Posts:
    28
    Ok I got it working by manually copying the apk to my android device, then I don't have the webpage at coui:://uiresources/test3.html" might be temporarily down. error anymore, it seems like if I do a "build and run" the apk is copied over to the device before the repack is done, as I put a breakpoint in StartProcess in AndroidPostProcessor.cs and watch the app be moved and run on the device while I was still sitting on the breakpoint before the jar signer does it's business....
     
  37. nikxio

    nikxio

    Joined:
    Oct 30, 2012
    Posts:
    69
    Hi Holon777,

    I can confirm that the 'Build&Run' option does not repack the APK to add the local resources as it seems to be pushed onto the device before the post-process step gets to do its job. We'll investigate possible solutions for the problem. As a temporary workaround, you can either build the APK and install it manually using adb (as you did) or create an Eclipse project and run it from the IDE.

    As for the aapt issue, we added code that copies the one from the SDK directory to avoid errors. It's going to be in the 1.5.4 version so here's the snippet you can add to automate the process before it's live:

    Somewhere in AndroidPostProcessor.cs: (add "using System.Linq;" at the top)
    Code (csharp):
    1.  
    2. public static void FindAndCopySdkAapt()
    3. {
    4.     // Locate aapt in SDK dir
    5.     string searchDir = Path.Combine(GetAndroidSDKDir(), "build-tools");
    6.     if (!Directory.Exists(searchDir))
    7.     {
    8.         UnityEngine.Debug.Log("build-tools folder not found in SDK folder. Falling back to packaged aapt.");
    9.         return;
    10.     }
    11.        
    12.     string[] buildToolsSubdirs = Directory.GetDirectories(searchDir);
    13.     if (buildToolsSubdirs.Length == 0)
    14.     {
    15.         UnityEngine.Debug.Log("No directories found in SDK/build-tools folder. Falling back to packaged. aapt.");
    16.         return;
    17.     }
    18.    
    19.     var aaptFiles = buildToolsSubdirs.SelectMany(dir => Directory.GetFiles(dir, "aapt*"));
    20.     if (aaptFiles.Count() == 0)
    21.     {
    22.         UnityEngine.Debug.Log("aapt not found in SDK/build-tools folder. Falling back to packaged. aapt.");
    23.         return;
    24.     }
    25.  
    26.     string selectedAapt = aaptFiles
    27.         .OrderByDescending(f => File.GetLastWriteTime(f))
    28.         .First();
    29.  
    30.     // Copy the found aapt to the apktool dir
    31.     string targetAapt = Path.Combine(GetAPKToolDir(), Path.GetFileName(selectedAapt));
    32.  
    33.     if (PlayerPrefs.HasKey("CoherentUI_AaptCopied")  File.Exists(targetAapt)  File.GetLastWriteTime(targetAapt) > File.GetLastWriteTime(selectedAapt))
    34.     {
    35.         UnityEngine.Debug.Log("aapt in Android SDK folder is older than the packaged one; skipping copy.");
    36.         return;
    37.     }
    38.    
    39.     UnityEngine.Debug.Log("aapt that will be used: " + selectedAapt);
    40.     File.Copy(selectedAapt, targetAapt, true);
    41.     PlayerPrefs.SetInt("CoherentUI_AaptCopied", 1);
    42. }
    43.  
    And call it in CoherentPostProcessor.cs by changing
    Code (csharp):
    1.  
    2. if (buildingAndroidApk)
    3. {
    4.     AndroidPostProcessor.UnpackAPK(pathToBuiltProject, androidUnpackDir);
    5. }
    6.  
    to:

    Code (csharp):
    1.  
    2. if (buildingAndroidApk)
    3. {
    4.     AndroidPostProcessor.FindAndCopySdkAapt();
    5.     AndroidPostProcessor.UnpackAPK(pathToBuiltProject, androidUnpackDir);
    6. }
    7.  
     
  38. boriel

    boriel

    Joined:
    Jul 2, 2012
    Posts:
    19
    Same here. Thanks for the tip! :wink:

    Basically, after build, executing in the command line
    Code (csharp):
    1. adb install Package.apk
    installs the correct apk (with the resources bundled) and the program works ok. :)
     
    Last edited: Oct 16, 2013
  39. Holon777

    Holon777

    Joined:
    Sep 29, 2012
    Posts:
    28
    I've purchased the mobile version and it works great on iOS, however I have a few issues on Android.

    We are using it to display google maps in one case, and xPos and yPos to move it into to place, however on iOS and Android height and width seem to have no effect, I can only control the size by creating an iFrame that refers to google maps and setting a percentage width and height with it, otherwise if just takes up the whole screen beyond xPos and yPos. What is the proper way to size the views on mobile?

    On Android taps are not going through to Unity if the tap is below the view, but taps above xPos/yPos position do go through, on iOS this is not an issue, I can tap below the view and they go to Unity, on Android in the google maps case if I tap and drag below the view the map still moves as if the view took up that space.

    Lastly on Android the response time in the views is much slower than iOS, on iOS on an iPad the response time seemed as fast as running the same page in the native browser, on Android it's about 4 times slower running in a Coherent UI view compared to the android native browser. Any special tips on this?

    In all these cases I'm just using a CoherentUIView attached to a camera.

    Great product! Running 1.5.2 Unity Mobile
     
    Last edited: Oct 17, 2013
  40. Holon777

    Holon777

    Joined:
    Sep 29, 2012
    Posts:
    28
    On Android if I try to pass parameters as part of the URL it fails, this is not a problem on iOS or in the editor.

    view.page = coui://uiresources/test.html?value=1 will not work on Android.
     
  41. Mr-Brent

    Mr-Brent

    Joined:
    Aug 20, 2013
    Posts:
    19
    I've been using ReadyForBindings to wait before I call things in my view, but I've found that occasionally I have to wait longer than that to actually call things in the view. Is there another event I should be waiting for before I "ExecuteScript" in the view? Right now I just end up yielding for 200ms after ReadyForBinding. It works fine, it just seems weird.
     
  42. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Where can I find a tutorial on how to use on demand views? I have a full license, but I can't figure out how to use these. The introduction blog post doesn't really describe how to use them, but describes what they can do. I have treasure chests in my map and when they open I want the score they award to float out of them. I figured I could use an on demand view with some simple jQuery and CSS to do this, but I don't get how to use these on demand views. Should I just add the CUI View script to an empty game object then mark it as on demand?
     
  43. stoyannk

    stoyannk

    Joined:
    Oct 30, 2012
    Posts:
    35
    On-demand views guarantee sync. between your game script, the JS executed in the page and the resulting image. They would be great if you need to move something in your interface in sync with something in the game, but I don't think this is your case - you want your treasure info to be in the 3D world itself.
    For the specific functionality you seek you'll have to add a plane on-top of you treasure chests and just attach a view on it. It doesn't matter if it's on-demand or a normal one - just create the content for it (probably with a transparent background) and use the binding functionality to pass the values that must be shown.

    As a general note, to make a view on-demand just click the check box. However I suggest you use normal views and mark them on-demand if you notice some lag and really need per-frame sync. between UI and game frames - 90% of the cases you will be fine with the normal ones.
     
  44. stoyannk

    stoyannk

    Joined:
    Oct 30, 2012
    Posts:
    35
    Yes, this is odd. Could you write some more details to support@coherent-labs.com, describing the issue. We'll look into it.
     
  45. boriel

    boriel

    Joined:
    Jul 2, 2012
    Posts:
    19
    Apparently View.Redraw() is not implemented for mobile?
    Code (csharp):
    1.  
    2. Assets/Refresher.cs(15,28): error CS1061: Type `Coherent.UI.Mobile.View' does not contain a definition for `Redraw' and no extension method `Redraw' of type `Coherent.UI.Mobile.View' could be found (are you missing a using directive or an assembly reference?)
    Or am I missing something? :confused:
    I find this useful especially to deal with some transparency issues I'm having with Android 4.3 (maybe redrawing the view will clean it).
     
  46. nikxio

    nikxio

    Joined:
    Oct 30, 2012
    Posts:
    69
    Thanks for reporting the issue, it's fixed in the 1.5.4 version which should be live by the end of this week.
     
  47. nikxio

    nikxio

    Joined:
    Oct 30, 2012
    Posts:
    69
    You're not missing anything :). The mobile version version implements a limited set of features (compared to the desktop version) but we're trying to bring the differences to a minimum.

    The Redraw method, as you have noticed, is desktop only. You should be able to force webkit to redraw through JavaScript using something like "element.style.webkitTransform = element.style.webkitTransform" - maybe this will work for you.

    As for the transparency, what kind of issues do you have? You can open a ticket by sending a mail to support@coherent-labs.com. If you have a repro case that would help our support team to resolve the problem.
     
  48. nikxio

    nikxio

    Joined:
    Oct 30, 2012
    Posts:
    69
    The view size was not taken into account when initializing the view in version prior to 1.5.3. In 1.5.2 You can do a resize with code right after the view is created as a workaround.

    In 1.5.3 we also fixed a bug in the android version that reported wrong coordinates for the generated CoherentTouches which might be the cause for your issue. The problem was that the XPos and YPos were not taken into account in the NewTouchEvent event handler defined in CoherentUIView.cs.

    And lastly, the response time should be comparable to the native android browser. Are you by any chance using click events instead of taps? Click events are fired with a delay because the view waits to see the gesture was actually a double tap. Could you please open a ticket at support@coherent-labs.com describing the scene setup so we can investigate it?
     
  49. Krileon

    Krileon

    Joined:
    Oct 30, 2012
    Posts:
    642
    Any idea regarding this please? I'm wanting to have floating numbers above a item that gives points. I assume the best way to do this is on-demand views, but I have no idea how to use them as I see no documentation for them and the blog post does not detail how to use them.
     
  50. DimitarT

    DimitarT

    Joined:
    Apr 8, 2013
    Posts:
    99
    I believe you've missed our answer - http://forum.unity3d.com/threads/15...eware/page20?p=1392287&viewfull=1#post1392287

    In short - On-Demand views provide way to sync Coherent UI views and Unity3D rendering.
    Do these numbers need to be in the 3D world or just on the screen. If they are on the screen - you can add a div in your UI view and move it to match the projected position of the box on the screen. If they must be absolutely in sync with Unity3D - this is where you can use On-Demand views - just check "Is On-Demand".
    If the numbers must be in the 3D world and you want to show/hide them when the player gets near - you can create and destroy them when necessary or just enable/disable the views to make them stop rendering.