最想做的事
天津理工大学是一本还是二本General information
uLiveWallpaper is a Unity extension allowing you to create Live Wallpapers for Android using the full potential of Unity 5 in an efficient and easy way.
Bring your creativity to your phone's home screen with the power of Unity and uLiveWallpaper!
Highlights:
▪Supports all latest Unity 5 features.
▪Supports ARMv7 and x86 devices running Android 2.3+.
▪Creates projects for Android Studio — the official IDE for Android application development.
▪Well-tested and extremely stable.
▪Convenient editor interface. Update your Android Studio project in a single click!
▪Clear and simple API.
▪Allows to automatically generate a simple Preference Activity for you to expand.
▪Full PlayMaker integration.
▪Documented demo examples.
Prerequisites
To develop live wallpapers with uLiveWallpaper, you’ll need the following: ▪Unity 5.0.0 or newer.
▪Android SDK v23 or newer.
▪Android Studio 1.5.0 or newer.
Installing prerequisites is beyond the scope of this manual, but if you are doing Android development, it’s likely you have Unity and Android SDK t up correctly already. Refer to this page for more information regarding Android SDK installation:
/Manual/android-sdktup.html
Android Studio is the official IDE for Android development. Information on how to install and u Android Studio is available at:
张飞庙/sdk/index.html
Usage
Open uLiveWallpaper window by calling
Tools → Lost Polygon → uLiveWallpaper
The window consists of three tabs: “Create Project”, “Update Project”, and “About & Support”.
To start creating your live wallpaper, first you must create a Live Wallpaper project for Android Studio. After the initial project is created, in order to reflect the changes made in your Unity project, you’ll need to update the project.
Creating and updating the Android Studio project
Note: to build and run your live wallpaper project, you must u Android Studio. “Build”and “Build And Run” buttons in “Build Settings” window will build a regular Unity project that is not compatible with live wallpapers.
Project creation
Step 1
Start Unity. Open uLiveWallpaper window and lect “Create Project” tab. Select the destination directory, lect project generation options and click the “Create Project” button.
This will generate an intermediate Eclip project. Now, it needs to be converted into Android Studio project.
Step 2
Start Android Studio.
In ca a “Welcome to Android Studio” splash screen appears:
Click “Import project (Eclip ADT, Gradle, etc.)” and lect the project you’ve just created. Click OK. “Import Project from ADT” window should open. Select the destination directory for imported project. Click Next, leave import ttings as-is, click Finish. Wait for import to succeed. You can delete the intermediate Eclip project now, it is no longer required.
Otherwi:
党群工作总结>油炸带鱼段的做法Click “ → New → ” and lect the project you’ve just created. Click OK. “Import Project from ADT” window should open. Select the destination directory for imported project. Click Next, leave import ttings as-is, click Finish. Wait for import to succeed.
Step 3
Click “ → New → → Import .JAR/.AAR Package” and import library, located in “Asts/uLiveWallpaper/Libraries/”directory inside your Unity project. Leave all ttings by default.
Step 4
Click “Fi le → ” to open the “Project Structure” window.
In the “Modules” list (on the left), lect the “app” module. Switch to “Dependencies”tab. Click the green “+” button at the right side and add Module dependency
“LP_uLiveWallpaper”.
Finally, click OK to clo the “Project Structure” window.
Step 5
Test if your wallpaper project builds fine by doing “Build → Rebuild Project”. If no errors will occur, you’re all t! Otherwi, recheck previous steps.
To run the live wallpaper on your device, first connect your device to the computer, then click the “Run” button ( ), or u “Run → Run” main menu item.
Note: after successfully installing the live wallpaper on your device, Android studio will log a message that says “Launched on <your-device-model>”. That message is not entirely truthful, since your live wallpaper will just be installed, not launched. You have to manually lect your wallpaper in the wallpaper picker dialog.
Project update
Start Unity and open your project. Open uLiveWallpaper window and lect “Update Project” tab. Select the directory of the Android Studio project you want to update, and click the “Update Project” button. That’s it! You should now be able to build and run your updated project from Android Studio.
In ca of any issues, make sure you’ve clod Android Studio and other applications that could be locking the updated Android Studio project directory, and try again. Note: this will only update the Unity player data, Unity native libraries, and uLiveWallpaper plugin. Your Android Studio project (l, application name, icons, etc.) will remain unchanged.
Building demo projects
“Virtual Box” demo project comes with a custom Android Studio project that includes an example of a custom Preference Activity. It is located at
“Asts\uLiveWallpaper\Demos\VirtualBox\VirtualBox_Android_Studio.zip”. Unpack the project somewhere, add “VirtualBox” demo scene to Build Settings and u “Update Project” function on the unpacked project.
Other demo projects do not have this requirement.
Settings Activity
Basic
翘首远望If “Settings Activity” is t to “Basic” when creating the project, your live wallpaper will include a basic preferences screen with two options: quality ttings (matches Quality Settings in Unity), and frame rate limit (lower frame rates result in better battery life). At some point you might want to extend this screen with some additional options. This is quite straightforward, as standard Android PreferencesActivity is ud. The layout of the preferences screen is described in “res/l”file inside your Android Studio project.
Official Android documentation on the subject (“Defining Preferences in XML” ction) /guide/topics/ui/ttings.html
You might also need to edit “res/l” file to edit values for your additional options.
Invisible Self-Closing
You might want to avoid using native Android Activity for the ttings screen, and instead implement the ttings screen yourlf, for example, by using Unity UI. To do that, t “Settings Activity” to “Invisible Self-Closing” and create your project. After that, you must subscribe to LiveWallpaper.PreferenceActivityTriggered event in your code. This event will be triggered when you tap the “Settings…” button in live wallpaper preview screen. You can then react to this event and show/hide your ttings UI.
Home Screen Shortcut
在学习方面You may want to create a home screen launcher to avoid forcing ur into going to wallpaper picker to change the wallpaper ttings. There are three options:
1.“None”. No home screen shortcut will be generated.
2.“Open Settings Activity”. Tapping the shortcut will open the Settings Activity. This
option is only available when “Settings Activity” is t to “Basic”.
3.“Open Preview Screen”. Tapping the shortcut will open the wallpaper preview
screen on Android 4.1 and newer, or the list of live wallpapers on older Android versions.
PlayMaker integration
uLiveWallpaper features full PlayMaker integration that includes all uLiveWallpaper properties, methods, and events.
After importing uLiveWallpaper, you have to also import PlayMaker support package. The package is located at:
Asts\uLiveWallpaper\uLiveWallpaper_PlayMakerIntegration.unitypackage
To enable PlayMaker integration, add the uLiveWallpaper prefab by clicking the menu item
PlayMaker/Addons/uLiveWallpaper/Components/Add PlayMaker uLiveWallpaper to Scene After doing that, you’ll have a new “uLiveWallpaper” category in your PlayMaker actions list.三坊七巷简介
PlayMaker i ntegration includes a simple “Rotating objects” demo that shows some basics oh how to u the actions, and to react to preferences changes. It comes with a custom Android Studio project that includes an example of adding custom preferences. It is located at
“Asts\uLiveWallpaper\PlayMakerIntegration\Demos\RotatingObjects\RotatingObject _Android_Stu
dio.zip”. Unpack the project somewhere, add “RotatingObjects” demo scene to Build Settings and u “Update Project” function on the unpacked project.