1 .当unity打包android的时候,未设置keystore ,会读取默认的keystore,具体为 :
代码是 :
return (Application.platform == RuntimePlatform.WindowsEditor) ?
System.Environment.GetEnvironmentVariable("HOMEDRIVE") + System.Environment.GetEnvironmentVariable("HOMEPATH") + @"\.android\debug.keystore" :
System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal) + @"/.android/debug.keystore";
对应的文件工程为 :
[2]Unity 的一些引用关系,比如说在Hierarchy界面中,找到引用: http://answers.unity3d.com/questions/648164/how-can-i-find-all-references-to-an-object-in-the.html 一个博客,打包可以使用 editorUtlity.collectReferences()收集依赖关系。http://answers.unity3d.com/questions/321615/code-to-mimic-find-references-in-scene.html#answer-933352
// 找到物品的引用关系,主要是通过
[MenuItem("CONTEXT/Component/Find references to this")]
private static void FindReferences(MenuCommand data)
{
Object context = data.context;
if (context)
{
var comp = context as Component;
if (comp)
FindReferencesTo(comp);
}
}
[MenuItem("Assets/Find references to this")]
private static void FindReferencesToAsset(MenuCommand data)
{
var selected = Selection.activeObject;
if (selected)
FindReferencesTo(selected);
}
private static void FindReferencesTo(Object to)
{
var referencedBy = new List<Object>();
var allObjects = Object.FindObjectsOfType<GameObject>();
for (int j = 0; j < allObjects.Length; j++)
{
var go = allObjects[j];
if (PrefabUtility.GetPrefabType(go) == PrefabType.PrefabInstance)
{
if (PrefabUtility.GetPrefabParent(go) == to)
{
Debug.Log(string.Format("referenced by {0}, {1}", go.name, go.GetType()), go);
referencedBy.Add(go);
}
}
var components = go.GetComponents<Component>();
for (int i = 0; i < components.Length; i++)
{
var c = components[i];
if (!c) continue;
var so = new SerializedObject(c);
var sp = so.GetIterator();
while (sp.NextVisible(true))
if (sp.propertyType == SerializedPropertyType.ObjectReference)
{
if (sp.objectReferenceValue == to)
{
Debug.Log(string.Format("referenced by {0}, {1}", c.name, c.GetType()), c);
referencedBy.Add(c.gameObject);
}
}
}
}
//表示是否存在某一个元素
if (referencedBy.Any())
Selection.objects = referencedBy.ToArray();
else Debug.Log("no references in scene");
}
[3]unity的存储格式,可以强制把场景等序列化信息改成.tex存储,这样的话,就能用.txt查看场景信息了。具体是editor->project setting ->editor ->Asset serialization ->force text、