はなちるのマイノート

Unityをメインとした技術ブログ。自分らしくまったりやっていきたいと思いますー!

【Unity】「InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.」というエラーの対処法

はじめに 以下のようなエラーが出てきたので、対処法をメモしておきます。 InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player …

【Unity】Unity公式のNewtonsoft JsonとNuGetからのdllを共存させる

はじめに Unity2020よりPackageManagerからNewotonsoft.jsonがインポートできるようになりました。 Unity2020でNewtonsoft.Jsonを入れる - Qiita Unity公式のNewtonsoft.jsonそれ以前ではdllを入れていたwww.nuget.orgただUnity公式のものとNuGetから取って…

【Unity】WAVファイルからAudioClipを動的に生成する(WAVEのファイル構造解析)

はじめに 今回はWavファイルからAudioClipを生成する方法について書きたいと思います。https://docs.unity3d.com/ja/2018.4/ScriptReference/AudioClip.Create.html https://docs.unity3d.com/ja/2018.4/ScriptReference/AudioClip.SetData.html はじめに 利…

【Unity】Unity2020.3.32f1でEnumerable.ReverseよりもArray.Reverseがめちゃ遅いんだが??

はじめに Unityを触っていて、なんだかArray.Reverseが遅く、Enumerable.Reverseにしてみたら速くなったという不思議な現象に出会いました。 https://docs.microsoft.com/ja-jp/dotnet/api/system.linq.enumerable.reverse?view=net-6.0 https://docs.micros…

【Unity】Unity公式のObjectPoolを使ってみる(内部実装も一部紹介)

はじめに 今回はObjectPoolについて紹介していきたいと思います。 The object pool pattern is a software creational design pattern that uses a set of initialized objects kept ready to use – a "pool" – rather than allocating and destroying them …

【C#】リトルエンディアンとビッグエンディアンの変換を行う

C#

はじめに 今回はエンディアンの変換についてお話したいと思います。 エンディアン(英: endianness)は、複数のバイトなどを並べる順序の種類である。一般的な用語による表現ではバイトオーダ(英: byte order)、ないしそれを一部訳して日本語ではバイト順…

【Unity, C#】InternalsVisibleToを用いて特定アセンブリからinternalにアクセスできるようにする

はじめに 今回はInternalsVisibleToという属性(Attribute)について紹介したいと思います。 同一アセンブリ内でないとアクセスできない皆さんご存知かと思いますが、internalを利用することで同一アセンブリでしかアクセスできないようにすることができます。…