Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Denik xrdnk

🏠
Working from home
View GitHub Profile
@xrdnk
xrdnk / LocalizeComponent_TMProExtension.cs
Last active Feb 22, 2022
TextMeshProUGUI コンポーネントに「LocalizeStringEvent」と「LocalizedTmpFontEvent」を Update Asset イベントに必要なプロパティを設定した上でアタッチしてくれるエディタ拡張
View LocalizeComponent_TMProExtension.cs
using System;
using TMPro;
using UnityEditor;
using UnityEditor.Events;
using UnityEngine.Events;
using UnityEngine.Localization.Components;
namespace xrdnk.Editor
{
/// <summary>
@xrdnk
xrdnk / LocalizedTmpFontEvent.cs
Created Jan 26, 2022
TMP_FontAsset 用の LocalizedAssetEvent
View LocalizedTmpFontEvent.cs
using System;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Localization;
using UnityEngine.Localization.Components;
namespace xrdnk
{
/// <summary>
@xrdnk
xrdnk / CustomOvrAvatarHandTrackingInputManager.cs
Created Jan 13, 2022
OvrAvatarInputManager(OvrAvatarBodyTrackingBehavior) の実装クラス(ハンドトラッキングを前提)
View CustomOvrAvatarHandTrackingInputManager.cs
using Oculus.Avatar2;
using Node = UnityEngine.XR.XRNode;
namespace xrdnk
{
/// <summary>
/// OvrAvatarInputManager の実装クラス
/// <para>ハンドトラッキングを前提としている</para>
/// <remarks>Meta Avatar のボディトラッキングに必要</remarks>
/// </summary>
@xrdnk
xrdnk / CustomOvrAvatarControllerInputManager.cs
Last active Jan 13, 2022
OvrAvatarInputManager(OvrAvatarBodyTrackingBehavior) の実装クラス(コントローラによるトラッキングを前提)
View CustomOvrAvatarControllerInputManager.cs
using Oculus.Avatar2;
using Node = UnityEngine.XR.XRNode;
using Button = OVRInput.Button;
using Touch = OVRInput.Touch;
namespace xrdnk
{
/// <summary>
/// OvrAvatarInputManager の実装クラス
/// <para>コントローラによるトラッキングを前提としている</para>
View LocalizationPresenter.cs
using Deniverse.UnityLocalizationSample.Domain.Service;
using Deniverse.UnityLocalizationSample.Presentation.Presentation.UIView;
using Deniverse.UnityLocalizationSample.Presentation.UIView;
using UnityEngine;
namespace Deniverse.UnityLocalizationSample.Presentation.Presenter
{
public sealed class LocalizationPresenter : MonoBehaviour
{
[SerializeField] LocalizationService _localizationService;
View LanguageSelectToggleUIView.cs
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.UI;
namespace Deniverse.UnityLocalizationSample.Presentation.UIView
{
public sealed class LanguageSelectToggleUIView : MonoBehaviour
{
[SerializeField] Transform _container;
View LanguageSelectDropdownUIView.cs
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.UI;
namespace Deniverse.UnityLocalizationSample.Presentation.Presentation.UIView
{
public sealed class LanguageSelectDropdownUIView : MonoBehaviour
{
[SerializeField] Dropdown _dropdown;
View LocalizationUIView.cs
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace Deniverse.UnityLocalizationSample.Presentation.UIView
{
public sealed class LocalizationUIView : MonoBehaviour
{
[SerializeField] Image _image_Flag;
[SerializeField] TextMeshProUGUI _text_HelloWorld;
View LocalizationService.cs
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.Localization.Settings;
using UnityEngine.Localization.Tables;
using UnityEngine.ResourceManagement.AsyncOperations;
namespace Deniverse.UnityLocalizationSample.Domain.Service
{
public sealed class LocalizationService : MonoBehaviour
@xrdnk
xrdnk / HyperLinkExample.cs
Last active Nov 1, 2021
TextMeshPro のテキストに URL 文字列が存在する時,ハイパーリンク化する
View HyperLinkExample.cs
using System;
using System.Text.RegularExpressions;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Denicode
{
public sealed class HyperLinkExample : MonoBehaviour, IPointerDownHandler
{