リポジトリ 使用例 using System.Linq; using Kogane; using UnityEditor; using UnityEngine; public static class Example { [MenuItem( "Tools/Hoge" )] public static void Hoge() { const BuildTargetGroup buildTargetGroup = BuildTargetGroup.Standa…
リポジトリ 使用例 デバッグ用のシーンが格納されているフォルダのパスを Project Settings で「Path Array」に設定すると Scenes In Build にシーンを追加した時にデバッグ用のシーンが リストの末尾に自動で移動するようになります また、先頭以外のシーン…
リポジトリ 使用例 Project Settings で「Is Enable」をオンにすると プレハブモードで開いているプレハブが Project ウィンドウでハイライトされるようになります
リポジトリ 使用例 using System; using UnityEditor; using UnityEngine; namespace Kogane.Internal { [CustomEditor( typeof( MeshRenderer ) )] internal sealed class MeshRendererInspector : Editor { private Editor m_editor; private SerializedPr…
リポジトリ 使用例 // protected な Save 関数を public で呼び出せるようにする拡張メソッド scriptableSingleton.Save( true );
リポジトリ 使用例 using System.Threading; using Cysharp.Threading.Tasks; using Kogane; using UnityEngine; public class Example : MonoBehaviour { private async UniTaskVoid Start() { var cancellationTokenSource = new CancellationTokenSource(…
リポジトリ 導入前 導入後
リポジトリ 使用例 iOSSilentModePlayAudio.SetAudioSession(); 上記の関数を任意のタイミングで呼び出します
リポジトリ 使用例 using Kogane; using UnityEngine; public class Example : ObsoleteMonoBehaviour { private void Start() { Debug.Log( name ); Debug.Log( enabled ); Debug.Log( transform ); Debug.Log( GetComponent<Transform>() ); } }</transform>
リポジトリ 使用例 using System.Threading; using Cysharp.Threading.Tasks; using Kogane; using UnityEngine; public class Example : MonoBehaviour { private readonly CancellationTokenSource m_cancellationTokenSource = new(); private async UniT…
リポジトリ 使用例 Before using System; using Cysharp.Threading.Tasks; using UnityEngine; public class Example : MonoBehaviour { private async UniTaskVoid Start() { await UniTask.Delay( TimeSpan.FromSeconds( 1 ) ); } } After using System; u…
リポジトリ 使用例 Before using System; using System.Collections.Generic; using Cysharp.Threading.Tasks; using UnityEngine; public class Example : MonoBehaviour { private async UniTaskVoid Start() { var list = new List<UniTask>(); for ( var i = 0; i </unitask>…
リポジトリ 使用例 using Cysharp.Threading.Tasks; using Kogane; using UnityEngine; public sealed class Example : MonoBehaviour { private async UniTaskVoid Star() { UniTask Impl1() => UniTask.CompletedTask; UniTask<bool> Impl2() => UniTask.FromRes</bool>…
リポジトリ 使用例 ProjectSettings フォルダに 「GvhProjectSettings.xml.source」というファイルを格納することで コンパイル開始時や Unity エディタがフォーカスされた時に 「GvhProjectSettings.xml.source」を「GvhProjectSettings.xml」に上書きコピ…
リポジトリ 使用例 using Cysharp.Threading.Tasks; using Kogane; using UnityEngine; public sealed class Example : MonoBehaviour { private readonly InternetCheckerInstance m_instance = new ( "8.8.8.8", // Google Public DNS "8.8.4.4", // Googl…
リポジトリ 使用例 using Cysharp.Threading.Tasks; using Kogane; public static class InternetChecker { private static readonly string[] ADDRESSES = { "8.8.8.8", // Google Public DNS "8.8.4.4", // Google Public DNS "4.2.2.2", // Level 3 Commu…
リポジトリ 使用例 Project Settings で「Is Enable」をオンにすると シーンの Dirty フラグが立った原因が Console ウィンドウに出力されるようになります
リポジトリ 準備 本パッケージを使用するためには Python のインストールと 以下の Python パッケージのインストールが必要です pip install librosa pip install soundfile 使用例 using Kogane; using UnityEditor; public static class Example { [MenuIt…
リポジトリ 使用例 using Kogane; using UnityEngine; using UnityEngine.EventSystems; public class Example : MonoBehaviour { [SerializeField] private CustomStandaloneInputModule m_module; private void Update() { if ( EventSystem.current.IsPoi…
リポジトリ 使用例 using System; using Kogane; using UnityEditor; public static class Example { [MenuItem( "Tools/Hoge" )] public static void Hoge() { SetAndroidHomeToEnvironmentVariable.Set( EnvironmentVariableTarget.Process ); } }
リポジトリ 使用例 using Kogane; using UnityEngine; public sealed class Example : MonoBehaviour { private void Start() { ApplicationRestarter.Restart(); } } 対応しているプラットフォーム Unity Editor Android
リポジトリ 使用例 using Kogane; using UnityEngine; using UnityEngine.EventSystems; public sealed class Example : MonoBehaviour, IPointerClickHandler { void IPointerClickHandler.OnPointerClick( PointerEventData eventData ) { // シングルタッ…
リポジトリ 使用例 #if UNITY_IOS using Kogane; using UnityEngine; public sealed class Example : MonoBehaviour { private void Start() { SFSafariView.OpenURL( "https://www.google.co.jp/" ); } } #endif #if UNITY_IOS using Cysharp.Threading.Tas…
リポジトリ 使用例 using Kogane; using UnityEditor; [InitializeOnLoad] public static class Example { static Example() { // 開発ビルドかリリースビルドか設定します SetXcodePushNotificationOnPostProcessBuild.OnIsProduction = () => false; } }
リポジトリ 使用例 using Kogane; using UnityEngine; public sealed class Example : MonoBehaviour { private void Start() { var texts = new[] { "Awake", "Start", "Update", "FixedUpdate", "LateUpdate", }; // Update Debug.Log( texts.GetMostSimil…
リポジトリ 使用例 ApplicationBackgroundChecker.OnChanged = isBackground => Debug.Log( isBackground );
リポジトリ 使用例 using Kogane; using System.IO; using UnityEngine; public class Example : MonoBehaviour { private string m_text = string.Empty; private void OnGUI() { GUILayout.Label( ApplicationPath.PersistentDataPath ); GUILayout.Label(…
リポジトリ 使用例 // アプリケーションを実行している Android 端末の API Level Debug.Log( AndroidApiLevel.Value ); // アプリケーションを実行している Android 端末のバージョンが 13 以上なら true Debug.Log( AndroidApiLevel.IsAndroidVersion13OrH…
リポジトリ 使用例 using System; using UnityEngine; [Flags] public enum Attribute { FIRE = 1 << 1, AQUA = 1 << 2, GRASS = 1 << 3, } public sealed class Example : MonoBehaviour { [SerializeField] private Attribute m_attribute; } using Kogane…
リポジトリ 使用例 using Cysharp.Threading.Tasks; using Kogane; using UnityEngine; public sealed class Example : MonoBehaviour { private async UniTaskVoid Start() { var result = await NotificationPermissionRequest.RequestAsync( this ); Debu…