I tried beacon with Unity

It is S of Tokyo head office.

Recently, "cases of using Unity even outside the game" has increased more cases.
I am making an iPhone / Android application that uses beacon in the consignment case, and this time I will make iBeacon's receiver application with Unity.

What is beacon, what is it, in a word, it is a "weak radio wave emitting terminal".

We detect this weak radio wave on the smartphone and get the position information (UUID).

The range that can be detected is several centimeters / 1 m / 10 m and can be selected according to beacon specifications so that you can acquire location information in a narrow range.

For example, a beacon in the range of several centimeters can be placed next to the display item, information can be provided by bringing the smartphone closer to the beacon, and detection that the beacon in the range of 1 m approaches the product, a beacon of 10 m has come to a store (shop front) It is likely to be able to detect.

This is an assumed requirement to distribute personalized coupons on the spot to visitors who came to the store this time.

There are many kinds of beacons, but there seems to be many using Bluetooth weak radio waves.

This time, I will use iBeacon which Apple made its own standard.

Beacon has prepared the following two terminals. Both are compatible with the iBeacon standard.


It may be that I do not know the size, but it is just about 500 yen coin larger.
The left side is a button battery, the right side is driven by AAA batteries, both of which have batteries for more than a year.

The left side is "BLEAD®-Ver.2 "

The right side is "BVMCN 1101 AAB"

Well, beacon was ready so I will prepare the next one.

· Unity 5
· Android terminal compatible with BLE and terminal of iOS 7 or higher
· Asset called iBeacon

Please use BlueTooth Ver.4 terminal compatible with BLE (BlueTooth Low Energy) so that the Android terminal can detect the beacon. I think that it is almost OK if it is a recent terminal, but BlueTooth may not be Ver.4 if it is a little old terminal.
The iOS terminal is iOS 7 or higher, and beacon is supported.

Unity uses assets.
I tried some beacon assets, but because some things are not stable, I use the following paid asset named "iBeacon" itself.

Asset "iBeacon" $ 25
https://www.assetstore.unity 3d.com/jp/#!/content/15260

This asset is OK if you say "receive Beacon's information while launching the application". Please note that it is not verified in the case of making it resident in the background or sending information to the beacon.

Start Unity and proceed with implementation.

■ Mounting procedure

1. Import Assets

I think that it becomes like the following when importing.

unity 1

Let's select the scene called Scene / ibeaconreciverexample

2. Set UUID

unity 2

a. Select IBeaconReviver from Hierarchy.
b. Set the number of beacons to be monitored.
c. Specify the name of the beacon to be monitored.
d. Specify the UUID of the terminal you have memorized in advance.
e. Describe the location information displayed when launching the application.
After updating, let's click Update Description.

When you start up the application, it will be displayed as follows.

unity 3

3. Launch app on device

Then let's actually start the application on each Android and iPhone device.

Beacons are between the terminals.

unity 4

About the items displayed on the screen of the terminal, UUID / Major / Minor can be set as a beacon. Set beforehand when installing the beacon.
You can use this information to determine which beacon you received.

[Range] The distance from the beacon. Since it can not take an accurate distance, it will be a rough distance.
Immediate: Beacon → It means that it is in close range.
Near → It means that it is close range.
Far → It means that it is at a long distance.
Unknown → Beacon's distance is unknown.

[Rssi] Received intensity. The higher the value, the better reception condition is shown, but the value may become 0 when Range is unknown.


By using assets, I think that Unity can easily acquire beacon information.

If it is simple, "If you can receive beacon information while launching the application"

· Apps to show museum exhibits
· Hints app that allows you to search clues for escape games
· Applications that can acquire coupons at each store
· Apps like stamp rally
· Okan will have beacon (paste it on clothes etc), an app will notify you when you get near the room (haha)

I think that things that can be done spread widely, such as.

It is a price (hundreds of yen to several thousand yen) that you can buy beacons individually, so you can feel free to experiment.