Skip to content

Instantly share code, notes, and snippets.

@kawai-hiroyuki
kawai-hiroyuki / file0.txt
Created November 26, 2018 14:59
座標から国コードを取得する方法 ref: https://qiita.com/hiroyuki7/items/25f7a95aa886271caf60
CLGeocoder *geocoding = [[CLGeocoder alloc] init];
CLLocation *location = [[CLLocation alloc] initWithLatitude:35.169688 longitude:136.899713];
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
[geocoding reverseGeocodeLocation:location preferredLocale:locale completionHandler:^(NSArray< CLPlacemark *> * __nullable placemarks, NSError * __nullable error) {
CLPlacemark *placemark = placemarks.firstObject;
NSLog(@"country:%@", placemark.country);
NSLog(@"isoCountryCode:%@", placemark.ISOcountryCode);
}];
@kawai-hiroyuki
kawai-hiroyuki / file0.txt
Last active August 29, 2015 14:14
Unity Ads(Unity Package)の導入方法 ref: http://qiita.com/hiroyuki7/items/ac607e3df11101b0c90a
using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;
public class UnityAdsScript : MonoBehaviour {
// Use this for initialization
void Start () {
// ゲームIDを入力して、Unity Adsを初期化する
Advertisement.Initialize ("123456789");
@kawai-hiroyuki
kawai-hiroyuki / file0.txt
Last active August 29, 2015 14:14
シーンを遷移してもBGMを継続して再生する方法 ref: http://qiita.com/hiroyuki7/items/b11496a3b72e89affdd0
using UnityEngine;
using System.Collections;
public class MainSoundScript : MonoBehaviour {
public bool DontDestroyEnabled = true;
// Use this for initialization
void Start () {
if (DontDestroyEnabled) {
// Sceneを遷移してもオブジェクトが消えないようにする
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<padding android:left="10dp" android:top="10dp"
android:right="10dp" android:bottom="10dp" />
<corners android:radius="4dp" />
<gradient
android:angle="270"
android:startColor="#ff0000"
android:endColor="#0000ff"
android:type="linear" />