Skip to content

Instantly share code, notes, and snippets.

@baobao
baobao / CreateQRCodeWindow.cs
Last active December 22, 2025 07:45
QR Code Creator EditorWindow
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
/// <summary>
/// QRコード作成EditorWindow
/// </summary>
public class CreateQRCodeWindow : EditorWindow
@baobao
baobao / DownSamplingRenderFeature.cs
Created December 25, 2024 10:58
RenderGraph版URP拡張サンプルコード
using UnityEngine.Rendering.Universal;
public class DownSamplingRenderFeature : ScriptableRendererFeature
{
DownSamplingRenderPass _renderPass;
public override void Create()
{
// パスの作成
_renderPass = new DownSamplingRenderPass
using UnityEngine;
using System.Collections.Generic;
public class EventReceiverSample : MonoBehaviour
{
public enum AnimType {
TYPE_1, TYPE_2, TYPE_3
}
/// <summary>【実行可能】引数の無い関数</summary>
@baobao
baobao / ReflectionSample.cs
Last active March 6, 2025 12:23
【Unity】開発の幅が広がるC#のリフレクション入門のサンプルコード
using UnityEngine;
namespace info.shibuya24
{
internal class ReflectionSample : ParentReflectionSample
{
public static int StaticPublicField = 1;
private static int StaticPrivateField = 2;
internal static int StaticInternalField = 3;
protected static int StaticProtectedField = 4;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;
public enum TransformAccessType
{
transformAccess,
GetComponentAccess,
CachedTransform,
using Cysharp.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
public class SampleQRReader : MonoBehaviour
{
private string _result = "";
private WebCamTexture _webCam;
void Awake()
using UnityEngine;
using ZXing;
using ZXing.QrCode;
/// <summary>
/// QRコードの作成と読み込みヘルパークラス
/// </summary>
public static class QRCodeHelper
{
/// <summary>
using UnityEngine;
using UnityEditor;
using System.IO;
/// <summary>
/// QRコード作成EditorWindow
/// </summary>
public class CreateQRCodeWindow : EditorWindow
{
private enum QRImageSize
// OSC送信インスタンス
OSCSender m_sender;
public Slider slider;
void Start ()
{
m_sender = new OSCSender ();
// 送信クライアント名のセット、IPアドレス、ポート番号は適宜調整
// このIPアドレスとポート番号は受信側のIPアドレスとポート番号です
m_sender.Init ("TestClient", 8890, IPAddress.Parse ("192.168.3.11"));
@baobao
baobao / PropertyToIdPerformance.cs
Last active March 2, 2025 01:50
シェーダーを2.5倍早くする方法「http://shibuya24/info/entry/unity-shader-property-to-id」で使用したサンプルコード
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PropertyToIdPerformance : MonoBehaviour
{
public Material mat;
public bool toggle;
public int cnt = 5000;
int propId = 0;