Search Unity

[RELEASED] Rainity - Dynamic Wallpapers

Discussion in 'Assets and Asset Store' started by ckosmic, Oct 11, 2018.

  1. ckosmic

    ckosmic

    Joined:
    Jun 19, 2013
    Posts:
    21
    Overview
    Rainity is a helpful package that allows you to display Unity scenes on your Windows desktop with ease. Create interactive wallpapers that display over or under your desktop icons, or use Rainity's API to retrieve information from your computer! Rainity's name and idea is based off of Rainmeter, a Windows desktop customization tool.

    Screenshots/Media





    Key features

    • Unity scenes run right on top of the desktop
    • Customizable settings
    • Get CPU/RAM/VRAM/Disk information
    • Get program icons as usable Texture2D textures
    • Simulate keypresses (including media buttons)
    • Get the desktop image as a Texture2D
    • Functions to add/remove from startup
    • Place window behind desktop icons
    • Multi-monitor support
    • Rainity's API
    Rainity API
    Aside from the main Rainity script component, Rainity's API is a powerful way to customize your desktop application. Functions include getting system performance counters, getting file icons and the desktop wallpaper image as Texture2D's, simulating keypresses and more. Documentation is included in the package as a .PDF or can be found online here.

    Compatibility
    This package only operates on Windows computers due to its WinAPI calls. Unity 2018.1.0 and higher are the versions that work with Rainity since the .NET 4.x scripting runtime was officially supported in that version.

    Downloads
    Download Rainity from the Asset Store
    Demo build 1
    Demo build 2

    Known issues/bugs
    Some bugs still persist within Rainity, but are actively being fixed with each update.
    • [FIXED!] Key/mouse input does not work when window is under desktop icons (OnMouseOver, OnMouseEnter, OnMouseExit events still do work, however)
    • [FIXED!] The game's window doesn't get recognized if another window is active before Rainity's Start function is called
    • Some performance counters are off such as the CPU usage and RAM usage
     
    Last edited: Oct 22, 2018
    cel and code-blep like this.
  2. ckosmic

    ckosmic

    Joined:
    Jun 19, 2013
    Posts:
    21
    Version 1.4 is here, adding some nice new features!
    In Rainity 1.4, you can now:
    • Get the user's avatar image as a Texture2D (Rainity.GetUserAvatar())
    • Get the logged in user's username (Rainity.GetUserName())
    • Add an icon to the system tray with a context menu (Rainity.CreateSystemTrayIcon())
    I'm continuing to add more stuff to the asset so check back for more new features!
    Asset Store Link
     
  3. cel

    cel

    Joined:
    Feb 15, 2011
    Posts:
    46
    This is just brilliant, well done! Bought it straight away!
    Just a request if possible, could you include playmaker actions?
     
    ckosmic likes this.
  4. ckosmic

    ckosmic

    Joined:
    Jun 19, 2013
    Posts:
    21
    Versions 1.5 and 1.6 have passed introducing:
    • Mouse and some keyboard inputs work in applications that run behind the icons using a custom input system.
    • Windows audio visualization using a modified example project by hallidev
    • Open files and directories using the default program (Rainity.OpenFile(string fileName))
    • Get weather information including the city name, temperature, 7-day forecast, atmosphere, wind speed, current outside conditions, and more. (Rainity.GetWeatherInformation())
    Make sure to check the updated documentation to see how to use these new features!
     
  5. cel

    cel

    Joined:
    Feb 15, 2011
    Posts:
    46
    Hi ckosmic,

    Would it be possible to open programs using commands? (like when you use the command line?)
     
  6. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    Is is possible to use this as wallpaper if ppl doesnt has unity??
     
  7. ckosmic

    ckosmic

    Joined:
    Jun 19, 2013
    Posts:
    21
    You can open files/directories/programs using Rainity.OpenFile(string fileName). However, command-line arguments aren't supported yet, but they will be in the next update.
     
  8. ckosmic

    ckosmic

    Joined:
    Jun 19, 2013
    Posts:
    21
    Yes as long as the user running it has a 64-bit computer, it will work. :)
     
  9. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    Lets say i wana send wallpaper to my friend. Whats procedure to do it?? What will other person need to get this work
     
  10. ckosmic

    ckosmic

    Joined:
    Jun 19, 2013
    Posts:
    21
    All you have to do is send the build to whoever you want to and they can run it on their Windows computer.
     
  11. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    How is that guy gona use it as wallpaper??
     
  12. ckosmic

    ckosmic

    Joined:
    Jun 19, 2013
    Posts:
    21
    They just run the build and Rainity does the rest.
     
    Last edited: Oct 26, 2018
  13. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    I already tried your build and nothing happened??
     
  14. ckosmic

    ckosmic

    Joined:
    Jun 19, 2013
    Posts:
    21
    Are you on a 64-bit Windows computer?
     
  15. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    Yes

    Ok I tried your 2nd build it works but i dont see my icons
     
    Last edited: Oct 26, 2018
  16. Egil-Sandfeld

    Egil-Sandfeld

    Joined:
    Oct 8, 2012
    Posts:
    72
    Nice asset :) Playing around with it and got relatively quick up to speed. It does not like VR headsets attached functioning as a third monitor. You need to disable the VR monitor before Rainity works fully. Otherwise it's going to show over that VR monitor as well. Perhaps an idea (if possible) could be to select which screens Rainity should display on.

    Anyway, nice work! :)
     
  17. Beauque

    Beauque

    Joined:
    Mar 7, 2017
    Posts:
    61
    Hi,
    This is a great asset! The simplicity and the features gave me some new creation ideas already.
    However for my project I need to be able to pick and drag rigidbodies around with the mouse when the app is running behind desktop icons.

    I got this script from SharpCoder and edited it so it uses Rainity input system. It works fine in the editor but not in the build when the "Behind Icons" option is on....
    Code (CSharp):
    1.  
    2. using UnityEngine;
    3.  
    4. public class SC_DragRigidbody : MonoBehaviour
    5. {
    6.     public float forceAmount = 500;
    7.  
    8.     Rigidbody selectedRigidbody;
    9.     Camera targetCamera;
    10.     Vector3 originalScreenTargetPosition;
    11.     Vector3 originalRigidbodyPos;
    12.     float selectionDistance;
    13.  
    14.     // Start is called before the first frame update
    15.     void Start()
    16.     {
    17.         targetCamera = GetComponent<Camera>();
    18.     }
    19.  
    20.     void Update()
    21.     {
    22.         if (!targetCamera)
    23.             return;
    24.  
    25.         if (RainityInput.GetMouseButtonDown(0))
    26.         {
    27.             //Check if we are hovering over Rigidbody, if so, select it
    28.             selectedRigidbody = GetRigidbodyFromMouseClick();
    29.  
    30.         }
    31.         if (RainityInput.GetMouseButtonUp(0) && selectedRigidbody)
    32.         {
    33.             //Release selected Rigidbody if there any
    34.             selectedRigidbody = null;
    35.         }
    36.     }
    37.  
    38.     void FixedUpdate()
    39.     {
    40.         if (selectedRigidbody)
    41.         {
    42.             Vector3 mousePositionOffset = targetCamera.ScreenToWorldPoint(new Vector3(RainityInput.mousePosition.x, RainityInput.mousePosition.y, selectionDistance)) - originalScreenTargetPosition;
    43.             selectedRigidbody.velocity = (originalRigidbodyPos + mousePositionOffset - selectedRigidbody.transform.position) * forceAmount * Time.deltaTime;
    44.         }
    45.     }
    46.  
    47.     Rigidbody GetRigidbodyFromMouseClick()
    48.     {
    49.         RaycastHit hitInfo = new RaycastHit();
    50.         Ray ray = targetCamera.ScreenPointToRay(RainityInput.mousePosition);
    51.         bool hit = Physics.Raycast(ray, out hitInfo);
    52.         if (hit)
    53.         {
    54.             if (hitInfo.collider.gameObject.GetComponent<Rigidbody>())
    55.             {
    56.                 selectionDistance = Vector3.Distance(ray.origin, hitInfo.point);
    57.                 originalScreenTargetPosition = targetCamera.ScreenToWorldPoint(new Vector3(RainityInput.mousePosition.x, RainityInput.mousePosition.y, selectionDistance));
    58.                 originalRigidbodyPos = hitInfo.collider.transform.position;
    59.                 return hitInfo.collider.gameObject.GetComponent<Rigidbody>();
    60.             }
    61.         }
    62.  
    63.         return null;
    64.     }
    65. }
    This is a script you attach to the camera.


    Do you have any clue on why dragging with the left mouse button just doesn't work? Have you already achieved this in an other way?

    EDIT: It actually seems to be related to the fact that I have a dual screen.
     
    Last edited: Oct 3, 2019
  18. Arkolis

    Arkolis

    Joined:
    Feb 6, 2015
    Posts:
    34
    If you use Easy save, for dynamic settings and things, don't use Auto Save functions. They seem to break, or interupt, some things Rainity is doing and instead of the application becoming the background it becomes a foreground application.
     
  19. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    Guys any1 knows how to get Dropdown in UI working. I tried ranity input system but it doesnt work
     
  20. mr_turkey11

    mr_turkey11

    Joined:
    Nov 12, 2020
    Posts:
    2
    Does anyone know how to use the modified windows audio visualizer?? I have looked but i cant find it anywhere