Unity3d freeze after show Interstitial on iOs8 - unity3d

After show and close an Interstitial banner on ios8, the app freeze.
The app back to full operate after pressing Home button and re-activate it.
I'm working with unity 4.5.4f1, xcode6. This is the pseudo code that we're using:
...
ADInterstitialAd.onInterstitialWasLoaded += OnFullscreenLoaded;
...
private ADInterstitialAd fullscreenAd=null;
fullscreenAd = new ADInterstitialAd(true);
...
void OnFullscreenLoaded()
{
if(!fullscreenAd.loaded) return;
fullscreenAd.Show();
}

Issue of unity fixed on 4.5.6
http://issuetracker.unity3d.com/issues/the-app-freezes-after-closing-an-adinterstitialad

Related

how turn on flashlight when use camera ionic 3

I am currently using the camera Preview plugin in ionic 3, I have created a button to activate the flashlight plugin but when calling the method it returns null
if (this.flashlight.available()) {
this.isOn = false;
this.flashlight.isSwitchedOn() ? this.flashlight.switchOff() : this.flashlight.switchOn();
} else {
alert('Flashlight Not Available');
}
I want to have that button to use the flash as a flashlight while I using the camera.
You can use setFlashMode Method to set flash status
flashMode = 'on';
changeFlashMode() {
this.cameraPreview.setFlashMode(this.flashMode);
}
you can see this full article that do what you want to do from here

Unity: Animation won't play on trigger

Im having trouble to let Unity play my animations.
I gave my character an Animator. In this Animator I have this Animations:
The trigger between these Animations are working fine and are running correctly on play. The idle animation it self is played, while i can't get it to play the walk or the jump Animation in the game (both work fine in the inspector).
When on play the triggers are triggered, it even shows the blue bar under the walking or the jumping box, but the animation itself just wont be played in the game.
Here is the code I use to call the triggers:
void Update()
{
if (Input.GetKey(KeyCode.LeftArrow) || Input.GetKey(KeyCode.RightArrow)|| Input.GetKey(KeyCode.A)||Input.GetKey(KeyCode.D))
{
anim.SetBool("isWalk", true);
}
else
{
anim.SetBool("isWalk", false);
}
if (Input.GetKey(KeyCode.Space))
{
anim.SetBool("isJump",true);
}
else
{
anim.SetBool("isJump", false);
}
}
And the Transition Conditions (but these are working fine for me):
idle->jump: isJump =true,
jump->idle: isJump =fals,
idle->walk: isWalk =true,
walk->idle: isWalk =false,
screenshot of idle-> walk:
screenshot of walk->idle:
I hope someone can help me with this and please excuse my possibly bad english...
I had the same issue.
Solved it by unchecking 'Can Transition To Self' inside the transition pointing to the state that didn't play.

using admob banners in unity

I'm using the following code to implement a banner ad at the bottom on my game screen in unity.
using GoogleMobileAds.Api;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AdScript : MonoBehaviour {
// Use this for initialization
void Start () {
showBannerAd();
}
private void showBannerAd()
{
string adID = "ca-app-pub-***********";
//***For Testing in the Device***
AdRequest request = new AdRequest.Builder()
.AddTestDevice(AdRequest.TestDeviceSimulator) // Simulator.
.AddTestDevice("***********") // My test device.
.Build();
//***For Production When Submit App***
//AdRequest request = new AdRequest.Builder().Build();
BannerView bannerAd = new BannerView(adID, AdSize.SmartBanner, AdPosition.Bottom);
bannerAd.LoadAd(request);
}
// Update is called once per frame
void Update () {
}
}
When I run it I get a notification on the log of:
Dummy .ctor
Dummy Createbannerview
Dummy LoadAd
but not a mock pop up banner saying "a banner ad will be implemented here"
Will the ads be implemented when published or did I misunderstand a step in the tutorial?
Admob banners will only be displayed when building to ios or Android and running it on a target device. You will never see a banner in the unity editor.
It does not matter if you run test ads or not, they just won't show in the editor.

Loader during Unity IAP Callback

I want to put loader in between dialog boxes come up for the purchase. What is the way for this?
Because when game player press Buy button, he should require to wait for 5 to 10 second depends on internet speed and server response and this process happed 2 to 3 times because multiple dialogs come up within screen.
So in this case, may be player can leave the screen. I want to put the loader so that game player realise that some processing is running in background, he required to wait for some time.
At present I was following completely this code for Unity IAP setup.
Integrating Unity IAP In Your Game
I assume this is for mobile platform but even if its not still the following can be considered:
Simple solution is to create a full screen Image (UI/Panel) object in your UI to block clicks. I would use Animator component (with triggers) to display this panel in front of other UI when there is a background process running.
public class Loader : MonoBehaviour
{
public static Loader Instance;
Animator m_Animator;
public bool Loading {get; private set;}
void Awake()
{
Instance = this; // However make sure there is only one object containing this script in the scene all time.
}
void Start()
{
//This gets the Animator, which should be attached to the GameObject you are intending to animate.
m_Animator = gameObject.GetComponent<Animator>();
Loading = false;
}
public void Show()
{
Loading = true;
m_Animator.SetBool("Loading", Loading); // this will show the panel.
}
public void Hide()
{
Loading = false;
m_Animator.SetBool("Loading", Loading); // this will hide the panel.
}
}
Then in any script which manipulates UI:
public void BuyButtonClicked()
{
Loader.Instance.Show();
// process time taking stuff
Loader.Instance.Hide();
}
You can also create any kind of loading animation as child of panel object using simple images and animation tool inside Unity (for example rotating animation (use fidget spinner, its cool)).
And in case of Android where user have option to leave screen by pressing OS back button you can prevent going back by checking if any loading is in progress by following example:
// code for back button
void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
BackButtonPressed();
}
}
void BackButtonPressed()
{
if(Loader.Instance.Loading)
return;
// use back button event. (For example to leave screen)
}
Hope this helps ;)

Blank screen in game after automatic keypad lock in nokia S40

After the automatic keypad lock, when I unlock it, there appears a blank white screen and after 3-4 seconds, the game field appears. Any ideas, how to avoid this behaviour? I want that the game canvas should be immediately displayed after the unlock.
Update:
Here is my startApp method:
public void startApp() {
start();
}
public void start() {
instance = this;
display = Display.getDisplay(this);
display.setCurrent(myGame);
}