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. Dismiss Notice

Uni2LwP : Create Live Wallpapers with Unity 3.4.2 /3.5.7/ 4.0/4.0.1

Discussion in 'Assets and Asset Store' started by shinx, Feb 28, 2013.

Thread Status:
Not open for further replies.
  1. Viper0110

    Viper0110

    Joined:
    May 28, 2013
    Posts:
    2
    What's the Unity version that is recommended for using this plugin and having a reasonable apk size of around 5-7Mb?
     
  2. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    With Unity 3.4.2 you will get a 5-7 mb apk file size (even after install).
    With the other versions you will get bigger files (because of the libraries).

    For more information, please read point 3 on the FAQ page.
    http://mirageunity.wordpress.com/faq/
     
  3. baram10000

    baram10000

    Joined:
    May 24, 2013
    Posts:
    11
  4. feracon

    feracon

    Joined:
    Mar 4, 2013
    Posts:
    84
    Hey Shinx,

    Any idea why this code only hides one of the objects with the specified tag?

    Code (csharp):
    1.     public void SetShowAsteroidBelt2 (string opt)
    2.     {
    3.         bool show;
    4.        
    5.        
    6.         if (opt == "yes")
    7.             show = true;
    8.         else
    9.             show = false;
    10.        
    11.         foreach (GameObject go in GameObject.FindGameObjectsWithTag ("asteroidBelt2Tag")) {
    12.             go.renderer.enabled = (show);
    13.         }
    14.     }

    But this code works just find to hide several other tagged objects.

    Code (csharp):
    1.     public void SetShowAsteroidClose (string opt)
    2.     {
    3.         bool show;
    4.        
    5.        
    6.         if (opt == "yes")
    7.             show = true;
    8.         else
    9.             show = false;
    10.        
    11.        
    12.         foreach (GameObject go in GameObject.FindGameObjectsWithTag ("asteroidCloseTag")) {
    13.             go.renderer.enabled = (show);
    14.         }
    15.     }
    The only difference between the two cases are that the first is many many more objects and they all all nested in a game object. It still toggles the renderer of one of those nested objects though...
     
  5. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    If inside Unity you already chose Auto Rotation then it should work. Don't forget that some Android launchers disable that function. To really test if it's working you must install a launcher that actually supports Auto Rotation for Live Wallpapers (ex. Go Launcher )
     
  6. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295

    Everything seems to be working. I have tried both functions and they work.
    Are you sure that all the game objects have the same Tag ? Aside from that, I can't think of anything else.
     
  7. AntonObertiukh

    AntonObertiukh

    Joined:
    Mar 24, 2013
    Posts:
    4
    Eclipse build errors on Unity Pro 4.0.0 f7.

    1. Create a new project in Unity Pro 4.0.0 f7, nothing importing
    2. importing Uni2LWP.unitypackage
    3. Create an object of the cube
    4. Create a C # code reversal of the cube:

    void Update () {
    transform.Rotate (Vector3.right * Time.deltaTime * 10);
    }

    and cling to the cube script
    5. I go to the Build. Do the settings for both the android video: http://www.youtube.com/watch?v=hSd...line 1 Java Problem Can you help me? Thanks!
     

    Attached Files:

    Last edited: May 30, 2013
  8. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Hello,

    I need more information to help you. Can you please use the contact page (Click here). Fill in all the information and I will the reply you by email.

    Kind regards,
    Shinx
     
  9. ruslans3d

    ruslans3d

    Joined:
    May 6, 2013
    Posts:
    25
  10. redred77

    redred77

    Joined:
    May 31, 2013
    Posts:
    23
    It works great on Galaxy Note 10.1 Tablet (Jelly Bean).

    But I have some trouble on LG Optimus LTE (ICS) phone.
    When I set wallpaper from wallpaper preview window, it works time to time.
    If I set wallpaper when the Unity splash image is shown, it breaks and failed to set live wallpaper. Home screen shows original built-in image.
    And when I set wallpaper after Unity splash image, it works well about 30% rate.
    Even running as live wallpaper, some texture has errors like showing only black surface or particle system don't shows up.
    When I restart the phone, the live wallpaper works nice. So it has problem on 'preview screen' -> 'set wallpaper' order with timing issue.
    You told us that it will restart and no error will be shown but it doesn't restart and live wallpaper is not set forever.

    I tested it many times and found that, on Galaxy Note 10.1, unity's splash image is shown again and seems to reload completely.
    But on my LG Optimus LTE, it doesn't reload and might look like just trying to change drawing surface.
    (Seems like two threads are trying to access and some multithread issue comes out in Unity)

    I know that UnityPlayer works as singleton pattern and it's hard to make instance for preview and live wallpaper screen each.
    Actually it's unity's problem, but It would be nice if Uni2Lwp provides some clear and robust solution on surface transition problems
    because your library controls GLthread and inner functions.

    I even tried Fantasy Hot Air Ballon Journey which is mentioned on this thread, and it has same problem on my phone.
    Is this problem just occurs only on my phone? Or are you investigating and trying to solve this problem?
     
  11. darger

    darger

    Joined:
    Aug 30, 2012
    Posts:
    17
  12. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Yes I'm still working on both issues.
    If we set the live wallpaper when the splash screen in showing sometimes it sets.. sometimes it doesn't. From what I can tell it the success rate depends on various things (Unity version, how heavy the live wallpaper is, Android version, Android launcher and even device hardware).

    Regarding the second issue... this one is more difficult to solve (at least I still haven't found a way).From the tests that I made the problem resides in Unity Sendmessage function. You can also try this.
    Inside your Eclipse LWP project , comment/remove all the "UnityPlayer.UnitySendMessage" calls (inside onOffsetsChanged and getInitPref methods). If you remove every UnityPlayer.UnitySendMessage you can now set the live wallpaper as many times as you want (in my device it never crashes).

    Best regards,
    Shinx
     
  13. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Today I received an email asking me if Uni2LwP was compatible with App2SD.
    Yes it is.

    If you enable that option in your Android manifest file then the users can move the live wallpaper to the sdcard. This means that if your live wallpaper occupies 25MB in the internal memory device (after installed), the user can choose to move/split the app between internal memory and sdcard.
    The live wallpaper will use 500kb +- in internal memory and the rest will be inside the sdcard.


    Why haven't I suggest this before ? Well, because using this option introduces 2 problems with every live wallpapers in Android.
    The first one happens when the user connects the USB cable and access the sdcard. If the live wallpaper is set then it will stop running because the Android loses access to the sdcard.
    The second one happens when the user restarts the device. Android also loses access to the sdcard while booting up and the live wallpaper won't start.
    Both issues are entirely related to Android and how the system works.

    If you still wish to enable this feature, in Eclipse, open the Android Manifest file (AndroidManifest.xml) and select the option "Auto" in the install location attribute.

    $InstallLocation.png
     
  14. redred77

    redred77

    Joined:
    May 31, 2013
    Posts:
    23
    I tried it by commenting all 'UnityPlayer.UnitySendMessage()', but it still crashes on my phone when I set it on splash screen. I think it's because my live wallpaper is completed project which has bigger texture and complex C# scripts than simple example projects.
    It's curious that it works perfect on Galaxy Note 10.1. They just restart their glsurface all the time.
    Maybe UnityPlayer on android is treating Samsung devices different than others, since I disassembled UnityPlayer and checked some routines for Samsung specific devices. (I didn't analyze it in detail, just wanted to find some method to restart UnityPlayer seemlessly)

    Anyway, do you have some list of devices that works and not works perfectly?
    I am just about to publish my app and I wonder if it's acceptable rate of bug on real world.
     
  15. uran35

    uran35

    Joined:
    Feb 16, 2013
    Posts:
    25
    Hi Shinx!
    I made the LWP wiht your plugin, it work good, but on my phone i have a problem.
    Watch this video:
    [video=youtube_share;HsErpPk75_8]http://youtu.be/HsErpPk75_8
    Do you have idea why it happens and how to fix it?
     
  16. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Sorry, I don't have a list of devices. Regarding the specific issue of setting the live wallpaper when the splash is showing I don't think that you will get bad reviews because of that. A lot of people already published their live wallpapers using Uni2LwP and they are getting good reviews. I know it's not a solution, but you could add a Toast message onCreate() that informs the user to wait for the lwp to finish loading before pressing the "set live wallpaper"...

    Check this one created by Studio DKP https://play.google.com/store/apps/details?id=com.DKP.LilyHDfree
     
    Last edited: Jun 1, 2013
  17. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Apparently something is happening when the live wallpaper pauses/resumes. Does it happen when you turn off/on the screen? I suggest that you add some debug flags inside the onOffsetsChanged method and also inside the function (in Unity) that is receiving the offset values( if you are using the uni2lwp example it's called SetCamOffset)

    Also, have you checked the Logcat ?
     
    Last edited: Jun 1, 2013
  18. uran35

    uran35

    Joined:
    Feb 16, 2013
    Posts:
    25
    It doesn`t happen when i turn off/on. It happen only when i start 'heavy" apps like games. When i start other apps it work fine.
     
  19. potkpot

    potkpot

    Joined:
    Mar 8, 2013
    Posts:
    17
    Hi. I want to add in settings menu of LWP listbox to change scene of project. It means empty start scene send to another scene I can make it with GUI(menu on minescreen) but can not understand methods to send commands from android(LWP Settings file) to unity engine.
    feracon before wrote about script with hiding some objects from scene with checkbox, but it is so different.
     
  20. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    That's strange. From the video we can see that the Live Wallpaper is still running. The only thing that stops working is your script that handles the rotating cube. I can only suggest that you add some debug flags to see what's happening and check Logcat fo any errors.
    Also, is it available on Google play ? Can you send me the link or the apk to test it on my devices ?
     
  21. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    To send "commands" from java to Unity you can use UnityPlayer.UnitySendMessage. Check the demo that's included with Uni2LwP.

    Inside the lwp you will have something like this:

    Code (csharp):
    1. UnityPlayer.UnitySendMessage("Main Camera", "SetRotation", "yes");

    This means that you are calling a function inside Unity with the name SetRotation that's attached to the Main Camera object. The third parameter is the message that you want to send.

    Code (csharp):
    1. UnityPlayer.UnitySendMessage("GameObjectName1", "MethodName1", "Message to send");

    Also, to add a listbox to your lwp just follow this tutorial : http://mirageunity.wordpress.com/2013/03/23/how-to-add-a-listpreference-to-the-settings-menu/
     
  22. baram10000

    baram10000

    Joined:
    May 24, 2013
    Posts:
    11
  23. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    You have to check 3 things to fix that.

    - Open the file wallpaper_settings.xml that's inside the res/xml folder and check the default value of your CheckBoxPreference. In this example I have true. This means that my checkbox wiill be checked the first time the user runs the wallpaper.

    $1.png



    -Open you main class file and go to the location were you declared your variables. Since I chose true in the default value before, now I have to initialize the variable in the same way.

    $2.png



    - Lastly, go to the getInitPref() method (same file) and choose true when reading the prefs. default option.


    $3.jpg
    That's it :)
     
    Last edited: Jun 3, 2013
  24. uran35

    uran35

    Joined:
    Feb 16, 2013
    Posts:
    25
    Hi.
    Here is Log and test apk
    https://www.cubby.com/pl/My+Cubby/_96fa7c7b16f24dd79f31f2f69bfcf4a2

    On tablet(nexus 7) LWP stops working when i rotate screen..
     
  25. baram10000

    baram10000

    Joined:
    May 24, 2013
    Posts:
    11
    $screen.png
    and then Could you check this number, I actually checked all true.
    Every thing is ok about all checked box, but swipe box is different, I attached new script. I changed -7f not 0.5f to adjust direction.
    So could you give information of scaleFactor =4f and camSpeed= 0.10f , should I change other number to change that? If I use your basic setting, everything is ok, but If I change some number, It is not working when I use first time, but after checking on/off , It is working with my phone..

    Thank you for your help
     
  26. baram10000

    baram10000

    Joined:
    May 24, 2013
    Posts:
    11
    I found It, If I have to chage -7f but 7f
    Thank you...
     
  27. diman62

    diman62

    Joined:
    Jun 4, 2013
    Posts:
    1
    insert the game bmw e30 and e46
     
  28. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
  29. uran35

    uran35

    Joined:
    Feb 16, 2013
    Posts:
    25
    That's strange.. i can`t open your link... page not found..
     
  30. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    It's working just fine...
    PM sent.
     
  31. PixelShroom

    PixelShroom

    Joined:
    Nov 1, 2012
    Posts:
    17
    hello, I'm also getting the issues mentioned in this thread talking about starting when the loading screen is on.

    also I'm getting problems when I first switch from a different live wallpaper to the uni2lwp live wallpaper. Sometimes I get a loading screen that never loads the live wallpaper on the home screen. and sometimes it just shows a black screen forever. however when I turn off the phone for a little while and come back, it shows the loading screen again, and the live wallpaper works quickly after that .

    it
     
  32. potkpot

    potkpot

    Joined:
    Mar 8, 2013
    Posts:
    17
    Hi. I tried that with send massage to camera
    Code (csharp):
    1. UnityPlayer.UnitySendMessage("Main Camera", "SetScene", "0");
    in array SetScene int from 0 to 10

    camera script

    Code (csharp):
    1.  
    2. public int sce;
    3. private int loa;
    4. private int scen;
    5.  
    6. void Update ()
    7.    
    8. {      loa = Application.loadedLevel;
    9.        if ( loa != sce){                //after start load level just 1 time
    10.        Application.LoadLevel(sce);
    11.       }
    12. }
    13. public void SetScene (int scen)  
    14.    { sce = scen;   
    15.    }   
    16. }
    if i try play scene in editor all is work fine. Afrer changing "sce" is load new scene. But if i try set scene from listbox, scene have no changes.
    Can someone help to fix it
     
    Last edited: Jun 7, 2013
  33. App8ite

    App8ite

    Joined:
    Jun 6, 2013
    Posts:
    5
    I'm also seeing the error that the LWP is very slow to set:
    * Default LWP
    * Setting cubes LWP
    * Set LWP
    * Result: black screen for several minutes before cubes show

    Device: Samsung Galaxy S3 (Android 4.2.1)

    I've tried on my Nexus 7 and it seems to work fine. It's a problem as it doesn't work on one of the worlds most popular Android handsets!
    Tried some of the other LWP mentioned in this thread and they have the same error for me.
     
  34. AntonObertiukh

    AntonObertiukh

    Joined:
    Mar 24, 2013
    Posts:
    4
    Unity 4.1.5 was released. Mabye, Uni2LWP already can works with 4.1.5?
     
  35. PixelShroom

    PixelShroom

    Joined:
    Nov 1, 2012
    Posts:
    17
    maybe a quick solution in the meantime is to have a loading popup preventing the user to set the wallpaper (or maybe have the set wallpaper greyed out) until the loading of the wallpaper is done. but how would we go about doing this?
     
  36. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Change SetScene to receive a string.

    Code (csharp):
    1. public void SetScene (string scen){
    2.    sce  = int.Parse(scen);
    3. }
     
  37. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    No. Unity only fixed some issues with MonoDevelop on Windows. Libraries are still the same.

    It's probably possible to create some sort of opaque toast message that hides the "set Wallpaper" button. However, I don't know if it's possible to block the button itself. Even if the buttons are hidden, the user can still press on the opaque toast message and the wallpaper will try to set. There's also the need to create some sort of mechanism to inform us that the splash screen already dissapeared so we can hide the Toast message again.


    The user Rdias also suggested the same thing in this thread but I don't know if he managed to solve all that...
     
  38. baram10000

    baram10000

    Joined:
    May 24, 2013
    Posts:
    11
    Hi Shinx
    Do you have any idea to solve touch problem.
    Vertical mode is everything is fine, but If I rotate to 90 degree, touch does not working on landscape mode.
    It is fine if I reload from setting again.
    Do I have to input some information when my device is rotated?
     
  39. PixelShroom

    PixelShroom

    Joined:
    Nov 1, 2012
    Posts:
    17
    we would only need a loading dialog I would think. that would probably stop most people from clicking. also I think it's possible to have the loading dialog block any input until it's done. the only problem is finding out when it's finished loading. is there a way to send a message up to the android Java code as soon as the unity file initializes?
     
  40. WardeG

    WardeG

    Joined:
    Mar 25, 2013
    Posts:
    8
    Good afternoon
    Please email me the script to rotate the camera and not to bias
    Thank you in advance strongly

    I can not figure out how to do it
    I'm just learning to do it all
     
  41. troubl3mak3r

    troubl3mak3r

    Joined:
    Nov 18, 2012
    Posts:
    4
    hey guys, and shinx thanks a lot for your great plugin!
    About the loading interruption problem, what about using an unity internal GUI for the settings instead of standart settings lwp screen? Or maybe
    using the settings button to open a window directly in the unity lwp instead of a separate settings activity?

    Any news about the sound volume problem? is it possible to fix it at all?
     
  42. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Yes. I'm already implementing the "solution" in the next version of Uni2LwP. In the meantime if you don't want to wait for the next version please use this page to contact me and I will send you the solution.
     
  43. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    I don't think Dialogs are allowed in live wallpaper services. I will look into that. However, Toast messages are and I already have something working. Just need to create some sort of mechanism to inform us that the splash screen already finished loading.



    The loading interruption problem occurs when we press the "Set Live Wallpaper" button so unfortunately that won't work.
    Regarding the sound issue. I have spend several hours on it and I since we can't override the volumes keys when using Android services I believe that there isn't a solution.
     
  44. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Hello everyone,

    The next version of Uni2LwP will include the following:

    - App2SD;
    - Solution for the "touch" events issue;
    - Option to create a Toast message that hides the "Settings" and "Set Live Wallpaper" buttons (even with this the user can still press the buttons, although hidden);

    Expect the release next week.

    Best regards,
    Shinx
     
    Last edited: Jun 8, 2013
  45. PixelShroom

    PixelShroom

    Joined:
    Nov 1, 2012
    Posts:
    17
    Thats cool, looking forward to it. Btw I've seen some ad networks put an eula in the asking for a accept or dont accept. So i think it should be able to work
     
  46. potkpot

    potkpot

    Joined:
    Mar 8, 2013
    Posts:
    17
    It doesn't helps. First scene after setting another scene has no chages. On device set scene not loaded.
     
  47. redred77

    redred77

    Joined:
    May 31, 2013
    Posts:
    23

    Hi!
    Would you write some code snippet about touch event issue?
    I am just about to update my live wallpaper and want to fix touch event if it's simple.

    By the way, do you know how to set ProGuard?
    I usually set proguard on my projects but couldn't succeeded with this Unity, Uni2lwp project.
     
  48. invisiblesense

    invisiblesense

    Joined:
    Jan 21, 2013
    Posts:
    41
    Hi Shinx,

    I am having difficulty with the build option on Unity. Basically using the sdk manager I installed API from 2.2 onwards but now I can't build. I get the 'No Platform Found' message - I have all most of the platforms installed.

    What am I doing wrong? I'm using Mac btw.
    Please help!

    Thanks.
     
  49. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    It should have worked. Btw, why are you loading the level inside the Update() method? You can load the scene/level using it's name and inside the SetScene method:

    Code (csharp):
    1. public void SetScene (string scen)
    2. {
    3.      Application.LoadLevel(scen);
    4. }
     
  50. shinx

    shinx

    Joined:
    Feb 28, 2013
    Posts:
    295
    Hello,

    Use this link to contact me and I will send you the code.

    Regarding Proguard... sorry, but I couldn't make it work with Unity classes :(




    You probably installed the latest version of Android SDK tools and they aren't compatible with Unity 3.x and 4.0.x
    Revert back to version 21.1. Also, Eclipse ADT must have the same version.

    Read this to help you.
     
    Last edited: Jun 10, 2013
Thread Status:
Not open for further replies.