This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set targetFile=$(ProjectDir)\Properties\AndroidManifest.xml | |
set yyyy=%date:~0,4% | |
set mm=%date:~5,2% | |
set dd=%date:~8,2% | |
set tm=%time:~0,8% | |
set tm=%tm: =0% | |
set hh=%tm:~0,2% | |
set tt=%tm:~3,2% | |
set ss=%tm:~6,2% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var query = new SpreahSheetQuery("scoreRank"); | |
query.Select("id,name,hiscore"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DebugUtil | |
{ | |
public static void ListDump<T>(IEnumerable<T> datas) | |
{ | |
foreach (var data in datas) | |
{ | |
Console.WriteLine(data); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dict = new Dictionary<string,string>(); | |
var t = dict["test"];//↑で作ったばかりなので入ってるはずもなく、KeyNotFoundException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.Events; | |
using UnityEngine.UI; | |
public class ScrollableInputField : MonoBehaviour | |
{ | |
[SerializeField] | |
private InputField _targetInputField; | |
[SerializeField] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private List<Vector2> vlist= new List<Vector2>(); | |
public void Update() | |
{ | |
if (Input.GetMouseButton(0)) | |
{ | |
var pos = Camera.main.ScreenToWorldPoint(Input.mousePosition); | |
vlist.Add(pos); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using UnityEngine; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
public static class UIUtility | |
{ | |
public static EventTrigger.TriggerEvent AddEvent(this GameObject o,EventTriggerType e) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyUtil | |
{ | |
/// <summary> | |
/// 指定した1つ以上のGameObjectのlayerを一括で変更する | |
/// </summary> | |
/// <param name="layer">変更したいlayerId</param> | |
/// <param name="targetObjects">レイヤーを変更したい1つ以上のGameObject</param> | |
/// </summary> | |
public static void SetLayer(int layer,params GameObject[] targetObjects) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyUtil | |
{ | |
//渡された重み付け配列からIndexを得る | |
public static int GetRandomIndex(params int[] weightTable) | |
{ | |
var totalWeight = weightTable.Sum(); | |
var value = Random.Range(1, totalWeight + 1); | |
var retIndex = -1; | |
for (var i = 0; i < weightTable.Length; ++i) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class LinqExtensions | |
{ | |
public static T RandomAt<T>(this IEnumerable<T> ie) | |
{ | |
if (ie.Any() == false) return default(T); | |
return ie.ElementAt(Random.Range(0, ie.Count())); | |
} | |
} |