Skip to content

Instantly share code, notes, and snippets.

View elgraiv-take's full-sized avatar

take@elgraiv elgraiv-take

View GitHub Profile
@elgraiv-take
elgraiv-take / GenerationTimeHashString.cs
Last active April 27, 2025 09:46
コンパイル時に文字列をハッシュ化して定数に格納するための Incremental Source Generator
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System;
using System.Text;
using System.Threading;
using System.Linq;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using Microsoft.CodeAnalysis.CSharp;
@elgraiv-take
elgraiv-take / enumerable.h
Last active April 2, 2022 07:18
C#でのIEnumerableのようにC++でも実装のコンテナ型にAPIが影響されないようにやり取りするためのクラス
#pragma once
#include <memory>
namespace impl {
template<class T>
struct enumerable_iterator_impl_base {
using value_type = T;
virtual const value_type& get() = 0;
@elgraiv-take
elgraiv-take / GradientTexture.cs
Created September 26, 2021 05:07
GradientTexture
using UnityEngine;
using UnityEditor;
using System.Linq;
[CreateAssetMenu(menuName ="CustomTextaure/GradientTexture")]
public class GradientTexture : ScriptableObject
{
[SerializeField]
[GradientUsage(true)]
private Gradient _gradient;
@elgraiv-take
elgraiv-take / EventHandler.h
Created February 26, 2020 06:20
EventHandler
#include <list>
#include <functional>
#include <memory>
#include <mutex>
#include <type_traits>
template<typename TSender, typename... TArgs>
class EventHandler {
friend TSender;
public: