コガネブログ

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

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

【Unity】Risk of unwanted modifications

概要 Risk of unwanted modifications The following scripts on the Prefab open ion Prefab Mode use the [ExecuteInEditMode] attribute which means they may accidentally affect or be affected by Play Mode: XXXX See the documentation for [Execut…

【Unity】Corgi Engine で動く床に合わせてプレイヤーが移動しない場合

概要 Corgi Engine で動く床に合わせてプレイヤーが移動しない場合、 動く床に「Moving Platform Free」をアタッチすると 動く床に合わせてプレイヤーが移動するようになります

【Rider】ツールバーに好きなコマンドを追加する方法

概要 Rider のツールバーの空いている箇所を右クリックして 「メニューおよびツールバーをカスタマイズ...」を選択して 「メインツールバー」の中の項目を選択した状態で 「+ > アクションを追加...」を選択して 追加したいコマンドを選択して「OK」を押して…

【Fork】コミットメッセージを変更する方法

概要 コミットログを右クリックして「Interactive Rebase > Reword...」を押して 新しいコミットメッセージを入力して「OK」を押して 「Rebase」を押すとコミットメッセージを変更できます

【Unity】スクリプトからキャッシュサーバ(Accelerator)にアクセスしているか確認する方法

概要 using UnityEditor; [InitializeOnLoad] public static class Example { static Example() { EditorApplication.update += () => { Debug.Log( AssetDatabase.IsConnectedToCacheServer() ); }; } } AssetDatabase.IsConnectedToCacheServer() を使用す…

【Unity】Corgi Engine でプレイヤーがやられたかどうか検知する方法

概要 using System; using MoreMountains.CorgiEngine; using MoreMountains.Tools; using UnityEngine; public sealed class PlayerDeathListener : MonoBehaviour, MMEventListener<CorgiEngineEvent> { public event Action OnDead; private void OnEnable() { this.MMEvent</corgiengineevent>…

【C#】Flags が付いている列挙型で ALL を表現する方法

C#

概要 [Flags] public enum PokemonType { FIRE = 1 << 0, WATER = 1 << 1, GRASS = 1 << 2, ALL = FIRE | WATER | GRASS, } 上記のように Flags が付いている列挙型で ALL を表現している場合、 [Flags] public enum PokemonType { FIRE = 1 << 0, WATER = 1 …

【Visual Studio】構造体の表示色を変える方法

概要 Visual Studio メニューの「ツール > オプション」を選択して 左メニューの「環境 > フォントおよび色」を選択して 「ユーザータイプ - 構造体」を選択して「前景色」を変更して「OK」を押すと 構造体の表示色を変更できます

【Unity】Kinematic 2D で急な坂道(Slope)の上でジャンプできないようにする方法

概要 「Vertical Movement」の「Jump Only On Stable Ground」をオンにすると 急な坂道(Slope)の上でジャンプできないようになる

【Unity】Corgi Engine でブロックに潰されたらプレイヤーがやられるようにする方法

概要 Corgi Engine でブロックに潰されたらプレイヤーがやられるようにしたい場合は 「Character Crush Detection」と「Health」を使用する if (DieWhenCrushed) { // we kill the character _health.Kill (); CorgiEngineEvent.Trigger(CorgiEngineEventTyp…