2025年5月30日星期五

thumbnail

UMP ConsentStatus Always Not_Required when testing

UMP ConsentStatus Always Not_Required

UMP ConsentStatus Always Not_Required when testing, and no consent form popup.

Several thing you need to take care:

1) setup the privacy policy in amdob console with your  app package id included;

2) using Geography = DebugGeography.Eea to simulate Europe area;

3) Use new ConsentDebugSettings.Builder().addTestDeviceHashedId("xxxxxxxxx") to set this as a debug device. This id made me very confused at first. They need device hash id here, you could find such line code in the Android Studio LogCat console.  This id IS NOT adrvetiser id, and it will change by sdk versions. This means if you work with admob sdk 8.7.0, the device hash id you get is not the same as version 10.0.0 even with the same android device. The device hash id vary by different sdk version which take me a lot of time to find it. 

After go though all steps and fix the device hash id, the constent form popup. It's work!


Some device Ids

There are so many kinds of id on device. Such as device id, advertiser id, device hash id. They are different thing.  

Device id: use to identify a device uniquely. It is forbidden for some privacy reasons, and replaced with advertiser id. 

Advertiser id: use to deliver personalize ad to user.

Sometimes we need some unique device id to figureout which user is which, and send back some personalize information. If we have a account system, that is fine. Otherwise we generate some unique id basesd on such mac address, or random generated UUID while the app was fist time launched.

That's all!

ref: ump-consentstatus-always-notrequired-when-testing


2020年5月6日星期三

thumbnail

How to load binary data in Unity3D

The first step is to save your binary data file with the ".bytes" extension. Unity will treat this file as a TextAsset. As a TextAsset the file can be included when you build your AssetBundle. Once you have downloaded the AssetBundle in your application and loaded the TextAsset object, you can use the .bytes property of the TextAsset to retrieve your binary data.
thumbnail

Unity Physicals Rigidbody with multiple colliders

adding colliders changes the center of mass and rotation behaviour of a rigidbody. To set those manualy to the center of the object use:
void Start()
{
    rigidbody = GetComponent();
    rigidbody.centerOfMass = Vector3.zero;
    rigidbody.inertiaTensorRotation = new Quaternion(0, 0, 0, 1);
}
thumbnail

Unity-iPhone has Conflicting Provisioning Settings in XCode

1.Select the top level node called Unity-iPhone in the left tree view (the one with the blue item).

2.Select Automatically manage signing

3.Select your team (now the error message should appear)

4.Go to Build setting in the tab

5.Find the Group called "signing" in the structured table

6.Change the values from "iPhone Developer" to "iOS Developer"

7.Switch back to general (the error message should now disappear)

Your project should compile now and should be runnable on your iPad or iPhone. 
thumbnail

Unity Crash for small compressed texture on some Android device

I created a full white texture with 4x4 size. Unity requires that compressed texture size should be at least 4x4. This will cause some artifact on some Android device, and the frame rate was very slow. 

Later I tried to make true color for this small texture. This time no artifact and no frame rate slow problem. 

I think the texture compression is hardware bind. Althought Unity provide some compression methods, not all of them could be supported well by various of devices. 

Different devices may have different requirement even for the same compression. The most safe way is use true color for them. 
thumbnail

Unity3D Graphics Shader Optimization Tips

During the last few months, I have been working on the Graphics and shader optimization work. 
Good FPS is the balance between art and technocal. A good designed level  and game play should take account the potional performance issue. After the optimization work on the high level was done, we could deep into the lower level, and do some invistigation of shader part.
Here are some tips that you could try:
1) Don’t reinvent the wheel, use instrinsic functions; Some one would like to write his own ‘dot’ function, this is not allowed;
2) Use the most appropriate data types in calculations (float, float2, float3 and float4);
3) Get rid of typecasting when it’s not need. Such as convert float3 to float4, float to float4, fixed to half, half to float…
4) Instead of integers rely on floats for math;
5) When indexing into arrays of constants use integers instead of floats;
6) Combine scalar constants into full vectors, pack array elements into full constant vectors;
7) For conditional compilation use boolean constants declared as static;
8) Whennever possible vectorize code by joining similar operations together;
9) Do not use expensive functions, such as  log, exp, pow, sin, cos;
10) Well arrange the variable calculations among application objects, per vertex and per fragment. Per fragment is the most expensive, per vertex is less expensive, and per object is cheap;
11) Get rid of clip as possible, some one will suggest use alpha blend to replace alpah test;
12) Remove branch statements. Some powerful device will support branch well, like K1 device uber-shader;
13) Reduce the bandwith that pass from vertex shader to fragment shader;
14) Use constant variables when you could make sure what those value is:
15) Be careful on the precision such as float, half, fixed. Use theme properly, and get rid of typecast whenever possible.
thumbnail

APOCALYPSE RUNNER

In the game you are fleeing from the impending huge wave. You have to use every opportunity to not become a victim. Run along the rocky platforms, overcome obstacles, collect bonuses, earn points and compare them with the points of other players.

- Atmospheric setting
- Addictive gameplay
- Simple control
- Built-in online-record table

绝地逃亡是一款休闲类街机游戏,在游戏中你要从即将到来的巨浪中逃离。你要利用一切机会,不然就会变成牺牲品。沿着岩石一直跑下去,克服障碍,收集奖金,赚取积分,并与其他玩家的分数进行比较。

- 大气环境
- 易容上瘾的游戏
- 简单的操控
- 内置在线积分记录