Skip to content

Instantly share code, notes, and snippets.

Avatar

Masaki Takano srndpty

View GitHub Profile
@srndpty
srndpty / zapall.cs
Last active Oct 28, 2021
Zap all files from all subdirectories recursively
View zapall.cs
using System.IO;
namespace ZapAll
{
class Program
{
private static readonly char separator = Path.DirectorySeparatorChar;
static void Main(string[] args)
{
@srndpty
srndpty / pixiv_link_sanitizer.js
Created Feb 5, 2021
get rid of unwanted jump.php thing at pixiv
View pixiv_link_sanitizer.js
View RainbowGradient.shader
// based on UI-Default.shader which is available on https://unity3d.com/get-unity/download/archive
Shader "Custom/RainbowGradient"
{
Properties
{
[HideInInspector] [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
[HideInInspector] _Color ("Tint", Color) = (1,1,1,1)
[HideInInspector] _StencilComp ("Stencil Comparison", Float) = 8
[HideInInspector] _Stencil ("Stencil ID", Float) = 0
[HideInInspector] _StencilOp ("Stencil Operation", Float) = 0
@srndpty
srndpty / AngleBetween.cpp
Last active Feb 19, 2018
Get angle between 2 objects ignoring Y axis
View AngleBetween.cpp
#include <cmath>
struct vec3
{
float x, y, z;
};
float length(vec3 v)
{
return sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
View MinMaxSliderAttribute.cs
using UnityEngine;
using System.Collections;
public class MinMaxSliderAttribute : PropertyAttribute
{
public readonly float max;
public readonly float min;
public MinMaxSliderAttribute(float min, float max)
{
View TransformInspector.cs
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.Linq;
[CanEditMultipleObjects]
[CustomEditor(typeof(Transform))]
public class TransformInspector : Editor
{
enum TargetType
@srndpty
srndpty / AdvCommandLayerOff.cs
Created Jun 22, 2016
レイヤーを指定して消去する拡張コマンド
View AdvCommandLayerOff.cs
/// <summary>
/// レイヤーを指定して消去するコマンド
/// </summary>
public class AdvCommandLayerOff : AdvCommand
{
string layerName;
float fadeTime;
float waitEndTime;
public AdvCommandLayerOff(StringGridRow row)
View AdvCommandCharacter2.cs
internal class AdvCommandCharacter2 : AdvCommandCharacter
{
public static List<string> concurrectLayers = new List<string>();
public static bool toBeCleared = false;
public AdvCommandCharacter2(StringGridRow row, AdvSettingDataManager dataManager)
: base(row, dataManager)
{
}
View TestShading.shder
Shader "Custom/TestShading" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
}
SubShader {
Tags { "RenderType" = "Opaque" }
CGPROGRAM
#pragma surface surf Lambert
struct Input {
float4 color : COLOR;