Skip to content

Instantly share code, notes, and snippets.

View crl's full-sized avatar
🍊
Out sick

carl crl

🍊
Out sick
View GitHub Profile
@crl
crl / GrabPassBlit.shader
Created October 23, 2024 09:32 — forked from Refsa/GrabPassBlit.shader
Grab Screen Feature for URP 2.0
Shader "Hidden/GrabPassBlit"
{
Properties { }
SubShader
{
Tags { "RenderType"="Opaque" }
Pass
{
Name "FinalBlit"
@crl
crl / GrabPassBlit.shader
Created October 23, 2024 09:32 — forked from Refsa/GrabPassBlit.shader
Grab Screen Feature for URP 2.0
Shader "Hidden/GrabPassBlit"
{
Properties { }
SubShader
{
Tags { "RenderType"="Opaque" }
Pass
{
Name "FinalBlit"
@crl
crl / BlurEffect.compute
Created September 19, 2024 12:35 — forked from ArieLeo/BlurEffect.compute
Unity URP custom render feature for UI Blur
#pragma kernel Downscale
#pragma kernel GaussianBlurVertical
#pragma kernel GaussianBlurHorizontal
#pragma kernel BoxBlur
Texture2D<float4> _Source;
RWTexture2D<float4> _Dest;
float _Amount;
float2 _Size;
@crl
crl / LightFlickerEffect.cs
Created September 15, 2024 15:08 — forked from sinbad/LightFlickerEffect.cs
Unity simple & fast light flicker script
using UnityEngine;
using System.Collections.Generic;
// Written by Steve Streeting 2017
// License: CC0 Public Domain http://creativecommons.org/publicdomain/zero/1.0/
/// <summary>
/// Component which will flicker a linked light while active by changing its
/// intensity between the min and max values given. The flickering can be
/// sharp or smoothed depending on the value of the smoothing parameter.
@crl
crl / MD4.cs
Last active November 23, 2023 10:22
UGUI 由于降级产生所有脚本丢失 找回方法
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
public class MD4 : HashAlgorithm
{
private uint _a;
private uint _b;
@crl
crl / StartExternalProcess.cs
Created May 29, 2023 09:41 — forked from ParanoidMann/StartExternalProcess.cs
System.Diagnostics.Proccess.cs wrapped sources for IL2CPP
#if UNITY_STANDALONE_WIN
using Microsoft.Win32.SafeHandles;
using System;
using System.Security;
using System.Security.Permissions;
using System.Runtime.InteropServices;
using System.Runtime.ConstrainedExecution;
import urllib
import urllib.request
from urllib.parse import urlencode
import json
import sys
class JenkinsHttpPost:
def __init__(self,url):
self.url = url
def Post(self,postData):
@crl
crl / gist:f4598e9a4a56f57316c3aca22055f7e1
Last active October 25, 2023 12:47 — forked from Artein/gist:d91e9280838ea5a464fd861081645490
AndroidSymbolsShrinkerPostProcessor updates Android debug symbols to decrease the size via 7z
#if UNITY_EDITOR && UNITY_ANDROID
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
@crl
crl / pre-commit.sh
Created December 11, 2021 10:10 — forked from uhziel/pre-commit.sh
Subversion server pre-commit hook for Unity3D .meta file. 约束 Assets 目录下添加、删除、移动、改名文件或目录时,必须要携带对应 .meta 文件。 如果提交的 log 中包含"The Shawshank Redemption",可以逃避此规则。
#!/bin/bash
REPOS="$1"
TXN="$2"
SVNLOOK=svnlook
MAGICWORD='The Shawshank Redemption'
# Magic Word: The Shawshank Redemption.
# via http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-repository-hooks.html
@crl
crl / dependency_test.md
Created September 30, 2021 16:17 — forked from QXSoftware/dependency_test.md
资源依赖正确性测试

资源依赖正确性测试

本次测试包含对AssetDatabase.GetDependenciesEditorUtility.CollectDependencies这两个获取资源的依赖资源的 API 的测试,以及对于meta残留对打AssetBundle的影响。

AssetDatabase.GetDependencies

输入资源路径,例如Assets/Material/demo.mat,以路径形式返回该资源依赖的资源列表,例如Assets/Texture/demo.jpg

这个 API 返回的结果是“错误”的,也就是带残留的。比如某个材质,原本的shader引用了4个纹理,然后切换其shader为新的shader使之只引用一个纹理,这时AssetDatabase.GetDependencies返回的结果还是4个纹理。