This file contains hidden or 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; | |
| using System.Collections.Generic; | |
| using System.Reflection; | |
| using System.Text; | |
| public static class StatusHandler | |
| { | |
| private static readonly Dictionary<string, BindingFlags> m_BindingFlagsDic = | |
| new Dictionary<string, BindingFlags> | |
| { |
This file contains hidden or 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
| namespace UnityEngine.Simulation | |
| { | |
| public class Object | |
| { | |
| private static int s_IdCount = 0; | |
| private int m_InstanceID; | |
| private bool m_Alive = true; |
This file contains hidden or 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; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| public static class PathCombine | |
| { | |
| public static string Combine(params string[] subPath) | |
| { | |
| if (null == subPath || 0 == subPath.Length) | |
| { |
This file contains hidden or 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 class Bit | |
| { | |
| private const int INT_MAX_LENGTH = 32; | |
| private const byte BYTE_MAX_LENGTH = 8; | |
| public static bool Read(int source, int index) | |
| { | |
| Debug.Assert(index >= 0 && index < INT_MAX_LENGTH); | |
| return 0 != (source & (1 << index)); | |
| } |
This file contains hidden or 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 class ZipMng | |
| { | |
| public static byte[] Compress(byte[] originalData) | |
| { | |
| using (MemoryStream outms = new MemoryStream()) | |
| { | |
| using (MemoryStream inms = new MemoryStream(originalData)) | |
| { | |
| using (GZipStream gzs = new GZipStream(outms, CompressionMode.Compress)) | |
| { |
This file contains hidden or 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 UnityEngine; | |
| public static class AndroidSignCheck | |
| { | |
| private const string c_PackageName = "com.yangzhenlin.unitydemo"; | |
| public static byte[] GetSignature() | |
| { | |
| //Player = new UnityPlayer(); | |
| AndroidJavaClass Player = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); |
This file contains hidden or 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
| private static void CopyAndReplaceDirectory(string srcPath, string dstPath) | |
| { | |
| if (Directory.Exists(dstPath)) | |
| { | |
| Directory.Delete(dstPath); | |
| } | |
| if (File.Exists(dstPath)) | |
| { | |
| File.Delete(dstPath); |
This file contains hidden or 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
| private IEnumerator CopyVersion() | |
| { | |
| string _Version_txt_streamingAssetsPath = PathConf.VCRoot + "Version.txt"; | |
| if (_Version_txt_streamingAssetsPath.Contains("://")) | |
| { | |
| using (WWW www = new WWW(_Version_txt_streamingAssetsPath)) | |
| { | |
| yield return www; | |
| if (!string.IsNullOrEmpty(www.error)) | |
| { |
This file contains hidden or 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
| // This sample function uses SharpZipLib (http://icsharpcode.github.io/SharpZipLib/) to extract | |
| // a zip file without blocking Unity's main thread. Remember to call it with StartCoroutine(). | |
| // Byte data is passed so a MemoryStream object is created inside the function to prevent it | |
| // from being reclaimed by the garbage collector. | |
| public IEnumerator ExtractZipFile(byte[] zipFileData, string targetDirectory, int bufferSize = 256 * 1024) | |
| { | |
| Directory.CreateDirectory(targetDirectory); | |
| using (MemoryStream fileStream = new MemoryStream()) |
This file contains hidden or 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; | |
| using System.Collections.Generic; | |
| $if$ ($targetframeworkversion$ >= 3.5)using System.Linq; | |
| $endif$using System.Text; | |
| $if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks; | |
| $endif$ | |
| namespace $rootnamespace$ | |
| { | |
| class $safeitemrootname$ | |
| { |
NewerOlder