PlayerPrefs are present after uninstalling the app developed with unity? - unity3d

I am having a similar problem but only in one mobile SAMSUNG GALAXY S6, we are providing some default coins when player installs the game(suppose 15000). When i install the game, 14,500 coins are showing,when i checked it, playerperf has a key at the time of installing itself.I checked log but no use.No app data is present after uninstalling but the issue is occuring. Any help is welcome, Thanks in advance guys.

You can try to delete the PlayerPrefs before initializing the default coins.
PlayerPrefs.DeleteAll();
Use with caution - you can't undo that.

You could make some checking for example are you playing the game inside editor or on device something like this:
if(Application.isEditor)
{ // save coins with key}
else { //save coins but using different key }
Or replace PlayerPrefs with JSON.

Related

Flutter audioplayers package: Android vs iOS

I'm quite new into flutter and coding in general. I'm trying to build a meditation app, that plays a bell every 30/60/120... seconds, depends on user input. My code works perfectly fine on Android device, but when running on iOS, it plays bell only once and doesn't play anymore. Any suggestions please? Thank you!
if (((widget.meditation.notification) != 0) &&
((_time % widget.meditation.notification) == 0)) {
print('notification $_time');
audioCache.play('audio/bell.wav');
}
Finally I found solution, simply everytime .release() must be called.
By default, the player will be release once the playback is finished or the stop method is called.
This is because on Android, a MediaPlayer instance can be quite resource-heavy, and keep it unreleased would cause performance issues if you play lots of different audios.
On iOS and macOS this doesn't apply, so release does nothing.

Media from capture card in Unity with Vlc plugin for Unity

I am trying to get the camera feed from a blackmagic capture card into the mediaplayer of the Vlc plugin for Unity.
What i have done :
I can get the capture device with the vlc desktop application, so camera and capture card work fine.
I can run the sample scene of the vlc plugin which show an video from a web url, it works fine
I searched the LIBVLCSharp to try to understand a bit how it all works, https://code.videolan.org/videolan/LibVLCSharp/-/blob/master/src/LibVLCSharp/Media.cs
I am trying to modify the UseRenderingPlugin.cs, which is a script which plays the video on a texture in the Unity scene, and especially the line which chose the media to be played :
The original line of code :
_mediaPlayer.Media = new Media(_libVLC, "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", FromType.FromLocation);
And what i achieved so far (but doesn't work). I changed 'FromLocation' to 'FromPath' and replace the URL with the mrl to the capture card with the options, thanks to the vlc desktop application :
_mediaPlayer.Media = new Media(_libVLC, "dshow:// :dshow-vdev=Blackmagic WDM Capture :dshow-adev=Entrée ligne (Blackmagic DeckLink Mini Recorder 4K Audio) :dshow-aspect-ratio=16\\:9 :dshow-chroma= :dshow-fps=50 :no-dshow-config :no-dshow-tuner :dshow-tuner-channel=0 :dshow-tuner-frequency=0 :dshow-tuner-country=0 :dshow-tuner-standard=0 :dshow-tuner-input=0 :dshow-video-input=-1 :dshow-video-output=-1 :dshow-audio-input=-1 :dshow-audio-output=-1 :dshow-amtuner-mode=1 :dshow-audio-channels=0 :dshow-audio-samplerate=0 :dshow-audio-bitspersample=0 :live-caching=300 ", FromType.FromPath);
I would like to ask you if anyone knows the right syntax to use directshow in that function, or redirect me to a similar topic (that I haven't been able to found though, but i apologize if I missed it) or if I'm getting it all wrong.
Thank you so much for your time, it's the first time I use this plugin and LibVLCSharp so please be patient with me :D
Thank you #mfkl for your help.
Here is what has worked :
_mediaPlayer.Media = new Media(_libVLC, "dshow:// ", FromType.FromLocation );
And add all the options like this :
_mediaPlayer.Media.AddOption(":dshow-vdev='Blackmagic WDM Capture'");
_mediaPlayer.Media.AddOption(":dshow-fps=50");
...

How to use vuforia in unity with sound

I have a problem using vuforia with unity, I have 10 videos in database and when I start the App the sound from the videos start playing immediately even if there is no cards to read from.
Check you AudioSource components are on the target object, so it gets disabled.
If this happens and you still have the problem, add custom code so that it gets muted on OnTrackingLost and unmute in OnTrackingFound.
The class you are looking for id DefaulTrackableEventHandler, you can inherit from that one and add that code instead to our target using overrides or add code there like GetComponent.

Unity3d EasyAR Target loads at the start of the camera before find the trarget

I am tring to build an AR android app with unity3d last version and EASYAR SDK.
I have create the target and i am able to load my image or video at it's chile object but the child objct (cube or plane) load imediately when th camera opens.
i am looking some help on how i can apear the image or start the video when the camera find the target and not when the app starts.
thnns a lot in advanced guys for the help!!!
You can simply disable them in the beginning and modify the OnTargetFound event of the ImageTargetBehaviour script to enable them. Something like this:
public GameObject myARObject;
void OnTargetFound(TargetAbstractBehaviour behaviour)
{
Debug.Log("Found: " + Target.Id);
myARObject.SetActive (true);
}
Hope this helps.

Unity3D - Unity Ads lower down my Android FPS

So I decided to finally put Unity Ads on my Android game. I tried to build it on Windows platform and found no problem (FPS is fine)
But when I rebuilt it for Android, my FPS scaled down to 30+, what just happened?
I didn't put anything but integrating the Unity Ads so this time I just comment out the Ads that initializes the ads.
void InitializeAds(){
StartCoroutine(ShowAdWhenReady());
}
IEnumerator ShowAdWhenReady(){
while(!Advertisement.IsReady()){
yield return null;
}
Advertisement.Show();
}
In hopes that the FPS will go back to normal. But heck when I recompiled the APK and installed it on my phone the FPS still around 30+ FPS :/
Any help regarding this? I'm certain my game has good frame rate before I put the ads so I know there must be some kind of bugs on the plugin.
By the way, I invoked the InitializedAds on the Start method.
Thanks!
UPDATE:
I installed Unity Remote from Google Play to see if it's also going to have same low FPS but its NORMAL. So I recompiled the current Unity project, installed on my phone, FPS still SUCKS. This is so straaange T.T
Please try this for making FPS higher in your game,
Application.targetFrameRate = 60;
I guess, your problem will solved using this line.