コガネブログ

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

2022-08-30から1日間の記事一覧

【Unity】Some objects were not cleaned up when closing the scene. (Did you spawn new GameObjects from OnDestroy?)

概要 using UnityEngine; public class Example : MonoBehaviour { private void OnDestroy() { new GameObject(); } } using UnityEngine; public class Example : MonoBehaviour { public GameObject m_prefab; private void OnDestroy() { Instantiate( m…

【Unity】EventSystem.current.IsPointerOverGameObject が検出したゲームオブジェクトを取得する方法

概要 using JetBrains.Annotations; using UnityEngine; using UnityEngine.EventSystems; namespace Kogane { public sealed class CustomStandaloneInputModule : StandaloneInputModule { [CanBeNull] public GameObject GetLastPointerGameObject() { re…

【Unity】Line Renderer の Order in Layer を設定してもスプライトとの描画順が変わらない場合

概要 Line Renderer が使用しているマテリアルの Shader を 「Sprites/Default」にしたら描画順が設定できるようになった

【Rider】エラーや警告の内容がコード行に表示されるようになる「Inspection Lens」紹介

はじめに 「Inspection Lens」を Rider に導入することで エラーや警告の内容がコード行に表示されるようになります 導入前 導入後