コガネブログ

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

2019-05-04から1日間の記事一覧

【おすすめスライド】「エフェクトにしっかり色を付ける方法」

スライド

【おすすめスライド】「今、Unityプログラマに教えて上げたいC#のあれやこれや」

スライド

【おすすめスライド】「Unityで使える C# 6.0~と .NET 4.6」

スライド

【おすすめスライド】「【Unity道場スペシャル 2017京都】トゥーンシェーダー・マニアクス2」

スライド

【おすすめスライド】「【Unity道場スペシャル 2017京都】乱数完全マスター 京都編」

スライド

【おすすめスライド】「【Unity道場スペシャル 2017京都】いまのAssetbundle、次のAssetbundle」

スライド

【Unity】FPS を計測するスクリプト

スクリプト 使用例 using UnityEngine; public class Example : MonoBehaviour { private readonly FPSCounter m_fpsCounter = new FPSCounter(); private void Awake() { Application.targetFrameRate = 60; } private void Update() { m_fpsCounter.Update…

【Unity】プレハブもしくはプレハブのインスタンスの場合 false を返す拡張メソッド

ソースコード using UnityEditor; public static class UnityObjectExt { public static bool IsNotPrefab( this UnityEngine.Object self ) { var type = PrefabUtility.GetPrefabAssetType( self ); return type == PrefabAssetType.NotAPrefab; } } 使用…

【Unity】プレハブもしくはプレハブのインスタンスの場合 true を返す拡張メソッド

ソースコード using UnityEditor; public static class UnityObjectExt { public static bool IsPrefab( this UnityEngine.Object self ) { var type = PrefabUtility.GetPrefabAssetType( self ); return type != PrefabAssetType.NotAPrefab; } } 使用例 D…

【Unity】incorrect number of arguments to numeric-type constructor

概要 incorrect number of arguments to numeric-type constructor シェーダで上記のエラーが発生した場合は float3 col = float3(_Color); コンストラクタの引数の指定が float3 col = float3(_Color.r, _Color.g, _Color.b); 間違っている可能性があります…

【Unity】Android アプリ開発で使用できるプロファイラがまとめられている公式ドキュメント

概要 上記の公式ドキュメントで Android アプリ開発で使用できるプロファイラがまとめられています

【Unity】【Odin】Inspector で配列やリストを常に開いた状態にする方法

概要 using Sirenix.OdinInspector; using UnityEngine; public class Example : MonoBehaviour { [ListDrawerSettings( Expanded = true )] public string[] m_list; } ListDrawerSettings 属性で Expanded に true を設定する

【Xcode】has XXXX iOS Distribution certificates but their private keys are not installed. Contact the creator of one of these crrtificates to get a copy of the private key.

概要 has XXXX iOS Distribution certificates but their private keys are not installed. Contact the creator of one of these crrtificates to get a copy of the private key. Xcode でアーカイブしたデータを Validate しようとした時に 上記のエラー…

【Unity】頂点シェーダで済む処理はフラグメントシェーダではなく頂点シェーダで記述する

概要 v2f vert(appdata_t v) { v2f o; o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); o.color = v.color; return o; } fixed4 frag(v2f i): SV_Target { fixed4 col = 2.0f * i.color * _TintColor * tex2…

【Unity】1つの EditorWindow を複数開く方法

概要 var win = GetWindow<Example>( TITLE ); 通常、エディタ拡張でウィンドウを開きたい場合は EditorWindow.GetWindow を使用しますが この記述だと1つの EditorWindow を複数開くことはできません var win = CreateInstance<Example>(); win.titleContent = new GUIContent</example></example>…

【Unity】Error: Error while saving blame file, build will continue

概要 Error: Error while saving blame file, build will continue Error: 隕∫エ?繧ソ繧、繝?uses-sdk"縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺?k螻樊?ァ"tools:overrideLibrary"縺ョ謗・鬆ュ霎?tools"縺後ヰ繧、繝ウ繝峨&繧後※縺?∪縺帙s縲? UnityEngine.GUIUtility:ProcessEve…

【Unity】Vectrosity で頂点を回転させるソースコードのサンプル

アセット ソースコード using System.Collections.Generic; using UnityEngine; using Vectrosity; public class Test : MonoBehaviour { public float m_size; public Color m_color = Color.white; public float m_lineWidth; public float m_offset; publ…

【Jenkins】Jenkins API で変更履歴を取得する

概要 curl 【Jenkins の URL】/job/【ジョブ名】/【ビルド番号】/api/json?pretty=true?depth=1&tree=changeSet[items[author[fullName],comment]] 上記のようなコマンドで変更履歴を取得できる