コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

2018-05-29から1日間の記事一覧

【C#】浮動小数点以下の数値が存在する場合 true を返す拡張メソッド

C#

ソースコード public static class FloatExt { public static bool IsExistAfterDecimalPoint( this float self ) { return self % 1 != 0; } } 使い方 Debug.Log( 1f.IsExistAfterDecimalPoint() ); // False Debug.Log( 1.23f.IsExistAfterDecimalPoint() …

【C#】float 型から浮動小数点以下の数値を取得する拡張メソッド

C#

ソースコード public static class FloatExt { public static float GetAfterDecimalPoint( this float self ) { return self % 1; } } 使い方 Debug.Log( 1f.GetAfterDecimalPoint() ); // 1 Debug.Log( 1.23f.GetAfterDecimalPoint() ); // 0.23 関連記事

【Unity】Google 翻訳を使用できる「UniLang」紹介

はじめに 「UniLang」を Unity プロジェクトに導入することで Google 翻訳を使用できるようになります 使用例 using UniLang; using UnityEngine; public class Example : MonoBehaviour { private void Start() { var text = "My name is Pikachu."; var tr…

【Unity】uGUI で画像や文字がキラッと光る演出を実装できる「ShinyEffectForUGUI」紹介(2018/5/29 更新)

はじめに 「ShinyEffectForUGUI」を Unity プロジェクトに導入することで uGUI で画像や文字がキラッと光る演出を実装できるようになります 使用例 WebGL デモ https://mob-sakai.github.io/ShinyEffectForUGUI/ 導入方法 https://github.com/mob-sakai/Shin…