Skip to content

Instantly share code, notes, and snippets.

@andanteyk
andanteyk / TMP_Bitmap_Shadow.shader
Created February 10, 2024 11:36
ピクセルフォント囲み/影シェーダ
Shader "TextMeshPro/Bitmap_Shadow" { // この名前を変える
Properties {
_MainTex ("Font Atlas", 2D) = "white" {}
_FaceTex ("Font Texture", 2D) = "white" {}
[HDR]_FaceColor ("Text Color", Color) = (1,1,1,1)
[HDR]_ShadowColor ("Shadow Color", Color) = (0.5,0.5,0.5,1) // 追加
_ShadowFlag ("Shadow Flag", int) = 255 // 追加
// TMP を騙す
@andanteyk
andanteyk / Ziggurat.cs
Created April 30, 2023 07:14
Ziggurat / Modified Ziggurat method
// This code is licensed under the terms of the MIT license.
// For details, see https://gist.github.com/andanteyk/d08ab296665b3fc68df58beff3ea39cb .
// How to build:
// > dotnet new console
// > dotnet add package BenchmarkDotNet
// > dotnet run -c Release
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
#if UNITY_2019_1_OR_NEWER
// in unity environment
using UnityEngine;
using System.Reflection;
#else
// in dotnet environment
@andanteyk
andanteyk / LxmTest.cs
Created March 16, 2023 01:36
LXM PRNG test vectors
using Microsoft.VisualStudio.TestTools.UnitTesting;
using RngLab.Rng.Generators;
using System.Linq;
namespace RngLab.UnitTest.Generators;
[TestClass]
public class LxmTest
{
[TestMethod]
@andanteyk
andanteyk / unicode_sample.txt
Created June 19, 2022 08:05
Unicode の入力・表示テストに使える文字(列) (U+0000 null を除く)
 
العربية
ABCD
‮DCBA
لدي 100 تفاحة.
@andanteyk
andanteyk / Seiran.cs
Last active October 4, 2022 03:40
Seiran128 sample implementation in C# (.NET 5)
using System;
using System.Buffers;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
// This code is licensed under the terms of the MIT license.
// For details, see https://gist.github.com/andanteyk/d08ab296665b3fc68df58beff3ea39cb .
@andanteyk
andanteyk / houm_leng.txt
Created March 5, 2020 15:07
命中と射程が上がる組み合わせ
※命中と射程が上がるものだけ抜粋
41cm三連装砲改二:
 伊勢改二 (命中+3, 火力+3, 対空+2, 回避+1) x搭載数
 日向改二 (命中+3, 火力+3, 対空+2, 回避+2) x搭載数
二式艦上偵察機:
 伊勢改二 (命中+5, 火力+3, 回避+2, 装甲+1, 射程+1)
 日向改二 (命中+5, 火力+3, 回避+3, 装甲+3, 射程+1)
 飛龍改二 (命中+5, 射程+1), [★1以上](火力+2, 索敵+2)
@andanteyk
andanteyk / id229.txt
Created March 4, 2020 16:00
みんな大好き 12.7cm単装高角砲(後期型) の装備ボーナス
// 12.7cm単装高角砲(後期型) の装備ボーナス
if (夕張改二 || 夕張改二特 || 夕張改二丁) {
火力 += 本砲装備数;
対空 += 本砲装備数;
if (★7以上の本砲装備数 > 0 && 水上電探装備) {
火力 += 1;
回避 += 1;
}
if (★7以上の本砲装備数 > 0 && 対空電探装備) {
@andanteyk
andanteyk / attr.cs
Last active October 23, 2019 22:57
属性持ちの引数なしインスタンスメソッドを探して呼び出すテスト
public static void InvokeAttributedMethod<TInstance, TAttribute>(TInstance instance) where TInstance : class where TAttribute : Attribute
{
foreach (var method in typeof(TInstance).GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod))
{
var attr = Attribute.GetCustomAttribute(method, typeof(TAttribute));
if (attr == null)
continue;
if (method.GetParameters().Length > 0)
continue;
@andanteyk
andanteyk / luckluck.csv
Created September 7, 2019 22:05
改装前のほうが改修可能な運の量が多い艦
艦船ID 艦名 読み 改装段階 運初期 運最大 改修可能 最善値 増分
127 伊58 い58 0 40 79 39 79 0
399 伊58改 い58 1 50 79 29 89 10
77 伊勢 いせ 0 15 69 54 69 0
82 伊勢改 いせ 1 30 79 49 84 5
12 磯波 いそなみ 0 10 49 39 49 0
206 磯波改 いそなみ 1 12 49 37 51 2
16 うしお 0 20 79 59 79 0
233 潮改 うしお 1 20 79 59 79 0
407 潮改二 うしお 2 32 83 51 91 8