Skip to content

Instantly share code, notes, and snippets.

View QXSoftware's full-sized avatar

Hunter QXSoftware

View GitHub Profile
@QXSoftware
QXSoftware / it-ebooks.md
Created April 2, 2020 02:22 — forked from baiwfg2/it-ebooks.md
Download ebooks as you want
@QXSoftware
QXSoftware / GetFreeShadowsocks.py
Last active May 18, 2017 08:04
GetFreeShadowsocks
#encoding:utf-8
import traceback
import os
import os.path
import urllib2
import json
import re
from bs4 import BeautifulSoup
@QXSoftware
QXSoftware / Underline.cs
Last active March 21, 2023 03:08
Simple UGUI Underline
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
///
/// Unity 引擎的 mesh 顶点顺序如下:
///
/// (0)-------(1)(4)-------(5)
/// | | | |
@QXSoftware
QXSoftware / dependency_test.md
Last active March 25, 2024 14:59
资源依赖正确性测试

资源依赖正确性测试

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

AssetDatabase.GetDependencies

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

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

@QXSoftware
QXSoftware / Toolkit
Created November 9, 2016 07:43 — forked from gering/Toolkit
persitent data path handling in Unity with fallback
private static string[] _persistentDataPaths;
public static bool IsDirectoryWritable(string path) {
try {
if (!Directory.Exists(path)) return false;
string file = Path.Combine(path, Path.GetRandomFileName());
using (FileStream fs = File.Create(file, 1)) {}
File.Delete(file);
return true;
} catch {
@QXSoftware
QXSoftware / CameraInspector.cs
Created November 4, 2016 09:04
Camera inspector to modify opaqueSortMode and transparencySortMode
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
[CustomEditor(typeof(Camera), true)]
public class CameraInspector : Editor
@QXSoftware
QXSoftware / MeshRendererInspector.cs
Last active October 20, 2023 03:45
A unity mesh renderer inspector to view and modify renderer's sorting layer and material's render queue.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MeshRenderer), true)]
public class MeshRendererInspector : Editor
{
@QXSoftware
QXSoftware / strip_unity3d_doc.pl
Created September 20, 2016 07:11
Remove Unity3D Documentation analytic stuff
use strict;
use warnings;
sub process_html_file {
my $doc_file = $_[0];
open(DOC_FILE, "<", $doc_file) || die "Cannot open file : $!";
local $/;
my $content = <DOC_FILE>;
close(DOC_FILE);
$content =~ s#<script type=\"text/javascript\">\s*var _gaq = _gaq \|\| \[\];.+?</script>##s;
@QXSoftware
QXSoftware / KillUselessProcess.cmd
Created May 25, 2016 05:31
快速结束无用进程,有些 VS 的进程会拖慢其运行速度
@echo off
taskkill -f ^
-im TE.ProcessHost.Managed.exe ^
-im Microsoft.Alm.Shared.Remoting.RemoteContainer.dll ^
-im Microsoft.VsHub.Server.HttpHostx64.exe ^
-im WordBook.exe ^
-im wandoujia_helper.exe ^
-im VBCSCompiler.exe ^
-im Merge.exe ^