-
Notifications
You must be signed in to change notification settings - Fork 1
Android platform specific customization
This page lists platform specific customization options for Android.
Introduced in Browser Window 1.1.
Sets the color of a browser window's toolbar (usually the place where the page's title or URL is shown).
Accepts a Unity Color.
To make the custom tab red:
// Assuming androidConfig is a BWAndroidConfig
androidConfig.SetColor(Color.red);To set the same color as the main camera's background (useful in UI apps):
var cam = Camera.main;
if (cam != null) {
androidConfig.SetColor(cam.backgroundColor);
}A more complete example can be found in the sample scene: OpenColored()
Introduced in Browser Window 1.2.
Disables the sharing feature of a browser window.
// Assuming androidConfig is a BWAndroidConfig
androidConfig.DisableSharing();Introduced in Browser Window 1.2.
Sets the animations of a browser window. Accepts BWAndroidAnimations objects - the first is the start animation and the second is the exit animation.
BWAndroidAnimations is a class that holds the animation resource IDs for the entrance and exit animations.
When Android has to switch from your game to the browser window, it plays the start animations - specifically the entrance animation on the browser window and the exit animation on the game window. Once the user is done with the browser window and closes it, Android plays the exit animations - the exit entrance animation on the game window and the exit exit animation on the browser window.
By default you can use the 4 animations provided by Android in android.R.anim, which are already available in Browser Window as presets - BWAndroidAnimations.Fade (default) corresponds to fade_in and fade_out, while BWAndroidAnimations.SlideLeft corresponds to slide_in_left and slide_out_right.
To make the browser window appear by sliding in from the left and close with a fade:
// Assuming androidConfig is a BWAndroidConfig
androidConfig.SetAnimations(
BWAndroidAnimations.SlideLeft,
BWAndroidAnimations.Fade
);To make a custom start animation which slides in the browser window and fades out the game window:
// Assuming androidConfig is a BWAndroidConfig
var startAnim = new BWAndroidAnimations(BWAndroidAnimations.R_SLIDE_IN_LEFT, BWAndroidAnimations.R_FADE_OUT);
androidConfig.SetAnimations(
startAnim,
BWAndroidAnimations.Fade
);A more complete example can be found in the sample scene: OpenSlide().
Introduced in Browser Window 1.2.
Sets the start animation of a browser window. Accepts a BWAndroidAnimations object.
For more information about animations see the documentation on BWAndroidAnimations.
To make the browser window appear by sliding in from the left:
// Assuming androidConfig is a BWAndroidConfig
androidConfig.SetStartAnimation(BWAndroidAnimations.SlideLeft);Introduced in Browser Window 1.2.
Sets the exit animation of a browser window. Accepts a BWAndroidAnimations object.
For more information about animations see the documentation on BWAndroidAnimations.
To make the browser window close by sliding out:
// Assuming androidConfig is a BWAndroidConfig
androidConfig.SetExitAnimation(BWAndroidAnimations.SlideLeft);