2020-01-01から1年間の記事一覧
概要 Nintendo Switch 版「ガブッチ」が1/14まで半額セール中です! 不思議で可愛い生き物「ガブッチ」をゴールに導くアクションパズルゲームです ひらめき力が試される180個のステージを用意しています ダウンロードページ:https://ec.nintendo.com/JP/ja/…
概要 Unity 2020.1.16f1 で Windows のエクスプローラからファイルを Project ビューにドラッグしたらファイル名の先頭が「_」になる不具合に遭遇した 同バージョンでも Windows によってこの現象が発生する場合としない場合があった
概要 Failed tot start the unity package manager local server process. Make sure the process [XXXX/UnityPackageManager.exe] is not blocked by Windows Defender or any other anti-virus configuration. Click on Retry to relaunch Unity and reope…
概要 var files = Directory.GetFiles( path, "*.*", SearchOption.AllDirectories ); Directory.GetFiles に指定するパスでフォルダではなくファイルのパスを指定したら IOException: Error 267 このエラーが出た
概要 Debug.Assert と Debug.LogAssertion は Development Build の時のみ動作する Development Build ではない時にも動作させたい場合は BuildOptions.ForceEnableAssertions を使用する using System.Linq; using UnityEditor; public class Example { [Me…
概要 例えば Dictionary の初期化構文をコードフォーマットしたくない場合は using System.Collections.Generic; using UnityEngine; public class Example : MonoBehaviour { // @formatter:off private static readonly Dictionary<int, string> m_table = new Dictiona</int,>…
リポジトリ 使用例 すべてのシーンに対して処理を行う using Kogane; using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { SceneProcessor.ProcessAllScenes ( scene => { // シ…
リポジトリ 使用例 using Kogane; using UnityEditor; using UnityEngine; public static class Example { /// <summary> /// すべてのシーンに存在するゲームオブジェクトに BoxCollider をアタッチします /// </summary> [MenuItem( "Tools/Add BoxCollider to Scene" )] priv…
リポジトリ 使用例 using Kogane; using UnityEngine; public class Example : MonoBehaviour { private void Awake() { // 文字列を以下の型に変換する拡張メソッド // sbyte, byte, char, short, ushort, int, uint, long, ulong // float, double, decima…
リポジトリ 使用例 using Kogane; using UnityEngine; using UnityEngine.SceneManagement; public class Example : MonoBehaviour { private SceneLoadHistory m_history; private void Awake() { // シーン遷移の履歴の保存最大件数 var historyCount = 5;…
リポジトリ GameObject using Kogane; using UnityEngine; public class Example : MonoBehaviour { private void Start() { // GetComponent します // コンポーネントがアタッチされていない場合は AddComponent してから取得します var rigidbody = gameO…
リポジトリ 比較 導入前 導入後
リポジトリ 導入前 導入後
リポジトリ 実装環境 Unity 2020.2b2 導入前 導入後
リポジトリ 実装環境 Unity 2020.2b2 導入前 導入後
概要 当ブログで公開している全方位シューティングを作るチュートリアルを Unity 2020 に対応しました
はじめに 自分が GitHub に公開している Unity パッケージを300個以上まとめました 各パッケージは Unity Package Manager からインストール可能です まだドキュメントを記載できていないパッケージもあるのでご了承ください 多くのパッケージのライセンスは…
概要 Cannot recognize file type for entry located at 'XXXX.png'. Asset import failed or using an unsupported file type. アセットバンドルビルド時に上記のエラーが発生する状況に遭遇した Project ビューで .png を確認するとサムネイルが正常に表示…
概要 Could not create asset from XXXX.png: File could not be read .png のインポート時に上記のエラーが発生する状況に遭遇した Project ビューで .png を確認するとサムネイルが正常に表示されていなかった 画像編集ソフトや画像ビューアでは正常に .pn…
概要 DirectoryNotFoundException: Could not find a part of the path "XXX" or "YYY" File.Copy した時に DirectoryNotFoundException が出る状況に遭遇した 第2引数の destFileName に指定しているファイルパスが長すぎることが原因だった ファイルパスを…
リポジトリ 使用例 using Kogane; using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { // 「Some values driven by XXXX」の状態を取得 var rectTransform = ( RectTransform )…
リポジトリ 使用例 using Kogane; using System; using UnityEngine; public class Example : MonoBehaviour { public Action onClick; private void Awake() { // onClick 実行後に onClick は null になる ActionUtils.CallOnce( ref onClick ); } }
はじめに 「Unity-Native-Toasts」を Unity プロジェクトに導入することで iOS / Android でトースト表示できるようになります 使用例 using UnityEngine; using UnityNative.Toasts; public class Example : MonoBehaviour { private static readonly IUnit…
概要 Xcode の Info.plist の「Value」の欄の横幅が狭くて広げられない場合、 Xcode 右上の赤枠のボタンを2回押すことで、 「Value」の欄の横幅を限界まで広げることができます 参考サイト様
概要 #if UNITY_IOS using UnityEditor; using UnityEditor.Callbacks; using UnityEditor.iOS.Xcode; public static class Example { [PostProcessBuild] private static void OnPostProcessBuild ( BuildTarget buildTarget, string pathToBuiltProject ) …
概要 This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSUserTrackingUsageDescription key with a string value explaining to the user how the app use…
概要 git diff --cached -- "*.png" 上記のように記述する
概要 該当のアセットバンドルに含まれるアセットに対して AssetDatabase.ForceReserializeAssets を実行してみる もしもアセットに変更が発生する場合は、 そのアセットのシリアライズされているデータが古かった AssetDatabase.ForceReserializeAssets を実…
リポジトリ 使用例 using Kogane; using UnityEditor; using UnityEngine; public class Example { [MenuItem("Tools/Hoge")] private static void Hoge() { // Project ビューで選択されているフォルダと、 // そのフォルダ内のすべてのサブフォルダのパス…
順番 EditorApplication.playModeStateChanged の PlayModeStateChange.ExitingPlayMode MonoBehaviour.OnApplicationQuit Application.quitting MonoBehaviour.OnDestroy EditorApplication.playModeStateChanged の PlayModeStateChange.EnteredEditMode …