コガネブログ

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

2021-11-15から1日間の記事一覧

【Rider】よく使う機能と使わない機能を確認できる「Productivity Guide(生産性ガイド)」

概要 Rider メニューの「ヘルプ > 生産性ガイド」を押すと よく使う機能と使わない機能を確認できます

【Unity】Particle System のゲームオブジェクトが移動や回転した時にパーティクルを追従させないようにする方法

概要 Particle System のゲームオブジェクトが移動や回転した時に パーティクルを追従させないようにしたい場合は Simulation Space を「World」にします これでパーティクルがゲームオブジェクトの移動や回転に追従しなくなります 参考サイト様

【Unity】Instantiating material due to calling renderer.material during edit mode. This will leak materials into the scene. You most likely want to use renderer.sharedMaterial instead.

概要 using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var gameObject = Selection.activeGameObject; var lineRenderer = gameObject.GetComponent<LineRenderer>(); lineRenderer.materi</linerenderer>…

【Unity】SpringJoint2D を LineRenderer で表示するサンプル

ソースコード using UnityEngine; [DisallowMultipleComponent] [ExecuteAlways] [RequireComponent( typeof( SpringJoint2D ) )] [RequireComponent( typeof( LineRenderer ) )] public sealed class Example : MonoBehaviour { private SpringJoint2D m_sp…

【Unity】エディタ拡張で Sprites-Default マテリアルを使用したい場合

概要 var mat = AssetDatabase.GetBuiltinExtraResource<Material>( "Sprites-Default.mat" ); 上記のコードを書くとエディタ拡張で Sprites-Default マテリアルを使用できます</material>