This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void GetTCPPort() { | |
//UnityEngine.Debug.Log("Active Connections"); | |
// UnityEngine.Debug.Log(" Proto Local Address Foreign Address State PID"); | |
var curid = Process.GetCurrentProcess().Id; | |
var ports = new List<int>(); | |
foreach (TcpRow tcpRow in ManagedIpHelper.GetExtendedTcpTable(true)) { | |
if (tcpRow.State == TcpState.Listen && tcpRow.ProcessId == curid && tcpRow.LocalEndPoint.Address.ToString().StartsWith("127.0.0.1")) { | |
try { | |
Process process = Process.GetProcessById(tcpRow.ProcessId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
材质格式从 [prop_name]: value 转成 -first: name:prop_name second value: xxx | |
- (.*):\n m_Texture: (.*) | |
- first:\n name: $1\n second:\n m_Texture: $2 | |
find . -type f -name '*.prefab' -exec sed -i '' -e 's/m_IsPrefabAsset/m_IsPrefabParent/g' {} \; | |
find . -type f -name '*.unity' -exec sed -i '' -e 's/m_IsPrefabAsset/m_IsPrefabParent/g' {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using System; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
namespace lss.editor { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
::设置要永久加入到path环境变量中的路径 | |
set My_PATH=D:\a2_game\game_res\config\convertor\tools\lua\ | |
set PATH=%PATH%;%My_PATH% | |
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "Path" /t REG_EXPAND_SZ /d "%PATH%" /f | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tail -f file | awk '{now=strftime("%F %T%z\t");sub(/^/, now);print}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -maxdepth 1 -mindepth 1 -type d -exec sh -c 'echo "{} : $(find "{}" -type f | wc -l)" file\(s\)' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string ReadFileInAPK(string filepath) { | |
//取得应用的Activity | |
var activity = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity"); | |
//从Activity取得AssetManager实例 | |
var assetManager = activity.Call<AndroidJavaObject>("getAssets"); | |
//打开文件流 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MenuItem("Demo/Build Bundle")] | |
static void Build() | |
{ | |
BuildPipeline.BuildAssetBundles("Assets", BuildAssetBundleOptions.UncompressedAssetBundle, BuildTarget.Android); | |
FileUtil.DeleteFileOrDirectory ("obb.zip"); | |
var obbFile = ZipFile.Create ("obb.zip"); | |
obbFile.BeginUpdate (); | |
obbFile.Add ("Assets/bundle", CompressionMethod.Stored); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using System.IO; | |
using System.Linq; | |
namespace USplitAlpha | |
{ | |
public class SplitAlphaTextureCreator : AssetPostprocessor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#coding: utf8 | |
import os | |
import sys | |
print(str(sys.argv)) | |
obb =sys.argv[1] | |
def md5(file): |
NewerOlder