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
class WSNet { | |
//单例,方便使用 | |
public static Inst(): WSNet { | |
if (null == WSNet._inst) { | |
WSNet._inst = new WSNet(); | |
} | |
return WSNet._inst; | |
} | |
private static _inst: WSNet; |
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.IO; | |
using System.Linq; | |
using System.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
public class BuiltInImagesWindow : EditorWindow | |
{ | |
[MenuItem("Window/Built-in Images")] | |
public static void ShowWindow() |
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.IO; | |
using UnityEngine.Networking; | |
public class DownloadFileHandler : DownloadHandlerScript | |
{ | |
private FileStream mFileStream; | |
private HttpUtil.DownloadCallback mDownloadCallback; | |
private HttpUtil.FinishedCallback mFinishedCallback; | |
public DownloadFileHandler(FileStream fileStream, HttpUtil.DownloadCallback downloadCallback, HttpUtil.FinishedCallback finishedCallback) | |
{ |
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 ICSharpCode.SharpZipLib.Zip; | |
using System.Collections; | |
using UniRx; | |
using UnityEngine; | |
public static class ZipUtil | |
{ | |
public static IEnumerator Create(string name) | |
{ | |
string pakPath = string.Format("{0}/{1}.pak", Application.temporaryCachePath, name); |
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
/** | |
* Created by Ming on 2016/6/12. | |
*/ | |
public class Sphere { | |
private static final float[] Vertices = { | |
0f, 0f, 1.164415f, | |
9.929748E-09f, 0.2271661f, 1.142041f, | |
0.04431792f, 0.2228012f, 1.142041f, | |
0.08693273f, 0.4370403f, 1.075779f, | |
1.94779E-08f, 0.4456024f, 1.075779f, |
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.Security.Cryptography; | |
using System.Text; | |
public class HashTools | |
{ | |
public static byte[] GenMD5(byte[] source) | |
{ | |
MD5 md5 = new MD5CryptoServiceProvider(); | |
return md5.ComputeHash(source); |
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.Reflection; | |
using UnityEditor; | |
using UnityEngine; | |
public class EditorTools | |
{ | |
//获取场景内所有对象,无论是否Active | |
//http://wonderm.coding.io/2015/08/31/Unity-Editor-SelectAll/ | |
//感谢 白昼 |
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
//#define _Debug_Tools | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System.IO; | |
public class ImageManager : MonoBehaviour | |
{ | |
public static void Request(string url, System.Action<Texture2D> callback) | |
{ |
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 class ComboCounter | |
{ | |
public static float CurrentTime { get { return Time.fixedTime; } } | |
public System.Action onBegin; | |
public System.Action<int> onIncrease; | |
public System.Action<int> onEnd; |
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; | |
using System.Collections; | |
public class ShowProfile : MonoBehaviour | |
{ | |
public float SampleTime = 0.5f; | |
private float m_lastUpdateTime = 0.0f; | |
private float m_fps = 0.0f; | |
private int m_frame = 0; | |
void Update() |