2017-09-25から1日間の記事一覧
概要 下記のコマンドでインストール可能 go get -u github.com/vmihailenco/msgpack 次のようなプログラムで MessagePack が使用できることが確認可能 package main import ( "github.com/vmihailenco/msgpack" "fmt" ) func main() { type Item struct { Fo…
ソースコード using System; using System.Collections.Generic; using System.Xml; public static class XmlExt { public static IEnumerable<T> Select<T> ( this XmlNodeList self, Func<XmlNode, T> selector ) { foreach ( XmlNode n in self ) { yield return selector( </xmlnode,></t></t>…
ソースコード public static class DateTimeExt { public static bool IsMonday( this DateTime self ) { return date.DayOfWeek == DayOfWeek.Monday; } public static bool IsTuesday( this DateTime self ) { return date.DayOfWeek == DayOfWeek.Tuesday…
ソースコード public static class DateTimeExt { public static DateTime Tomorrow( this DateTime self ) { return value.AddDays( 1 ); } }
ソースコード public static class DateTimeExt { public static DateTime Yesterday( this DateTime self ) { return value.AddDays( -1 ); } }
ソースコード public static class DateTimeExt { public static bool IsBetween( this DateTime self, DateTime from, DateTime to ) { return from <= value && to >= value; } }
ソースコード using System.Xml; public static class XmlExt { public static string GetValueOrDefault ( this XmlAttribute self, string defaultValue = "" ) { return self != null ? self.Value : defaultValue; } } 使い方 var attr = node.Attribute…
ソースコード using System.Collections.Generic; using System.Linq; public static class IEnumerableExt { public static IEnumerable<T> NotNull<T>( this IEnumerable<T> self ) { return self.Where( c => c != null ); } } 使い方 var list = new [] { "フシギ</t></t></t>…
ソースコード using System; using System.Collections.Generic; public static class ListExt { public struct ForEachData<T> { private readonly int m_index ; private readonly T m_value ; private readonly bool m_isLast ; public int Index { get { re</t>…
はじめに ゲーム開発においてアイテムや商品ラインナップを五十音順で並べたい時などに 上記サイト様のプログラムを使用させていただいています 使い方 var list = new [] { "フシギダネ", "ヒトカゲ" , "ゼニガメ" , }; var sortedList = list .OrderBy( c …
概要 Unity で Game Center と連携するアプリを開発した タイトル画面で ILocalUser.Authenticate を呼び出して Game Center を認証するようにした Social.localUser.Authenticate( isSucceeded => {} ); 引数のコールバック関数が呼び出されたら次の処理に…
概要 2017/5/18 に、Trello 連携用のアセット 「Easy Feedback Form」がリリースされました 「Easy Feedback Form」を導入すると、 ゲーム再生中に Trello にバグを報告できるようになります 検証環境 Unity 2017.1.1 f1 Easy Feedback Form 1.0.3 公式ドキ…
WWW.LoadFromCacheOrDownload では 引数にヘッダー情報を渡すことができないので ベーシック認証ができない? ベーシック認証を URL に直接書く方法も試してみたがうまくいかず
ソースコード using System; using System.Collections; using System.Text; using UnityEngine; public class Example : MonoBehaviour { private IEnumerator Start() { var url = "【URL】"; var form = new WWWForm(); var headers = form.headers; var …
概要 2015/5/28 に、uGUI 拡張用のアセット 「EnhancedScroller」がリリースされました 例えばスマホゲームで、プレゼントボックスやランキング一覧などの画面で 数百から数千件のデータをスクロールビューで表示する場合、 ベタに実装しようとするとオブジ…