Skip to content

Instantly share code, notes, and snippets.

@maple-yang
maple-yang / dependency_test.md
Created September 12, 2018 04:52 — 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个纹理。

@maple-yang
maple-yang / Underline.cs
Created September 12, 2018 04:52 — forked from QXSoftware/Underline.cs
Simple UGUI Underline
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
///
/// Unity 引擎的 mesh 顶点顺序如下:
///
/// (0)-------(1)(4)-------(5)
/// | | | |
@maple-yang
maple-yang / NotchUtil.java
Created September 7, 2018 12:08 — forked from Jayatubi/NotchUtil.java
Detect notch on Android devices for Huawei, Oppo, Vivo
package com.actgames.fci.util;
import android.app.Activity;
import com.unity3d.player.UnityPlayer;
import java.lang.reflect.Method;
/**
* Created by mofei on 2018/5/11.
@maple-yang
maple-yang / PostBuildProcess.cs
Created July 5, 2018 14:00 — forked from suakig/PostBuildProcess.cs
PostBuildProcess.cs
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using System.IO;
using System.Collections.Generic;
public class PostBuildProcess : MonoBehaviour
{
internal static void CopyAndReplaceDirectory(string srcPath, string dstPath)
@maple-yang
maple-yang / ObjectPool.cs
Created May 29, 2016 13:13 — forked from wrh/ObjectPool.cs
Three kinds of generic object pools to avoid memory deallocations in Unity-based games. Released under a Creative Commons Attribution (CC BY) License, see http://creativecommons.org/licenses/ (c) 2013 Wendelin Reich.
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
////
//// Three kinds of generic object pools to avoid memory deallocations
//// in Unity-based games. See my Gamasutra articles.
//// Released under a Creative Commons Attribution (CC BY) License,
//// see http://creativecommons.org/licenses/
////
//// (c) 2013 Wendelin Reich.
////