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 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
| 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
| export default 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
| class Http { | |
| public static Inst(): Http { | |
| if (null == Http._inst) { | |
| Http._inst = new Http(); | |
| } | |
| return Http._inst; | |
| } | |
| private static _inst: Http; | |
| public constructor() { |
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; | |
| namespace Utils | |
| { | |
| public class MonoSingleton<T> : MonoBehaviour where T : MonoSingleton<T> | |
| { | |
| public static T Inst | |
| { | |
| get | |
| { |
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
| #!/usr/bin/env bash | |
| # 安装docker(使用阿里云源) | |
| yum install -y yum-utils device-mapper-persistent-data lvm2 | |
| yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo | |
| yum -y install docker-ce | |
| systemctl start docker | |
| # 迁移docker目录(可选) | |
| systemctl stop docker docker.socket |
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
| package Utils | |
| import ( | |
| "errors" | |
| "io" | |
| "math" | |
| ) | |
| func WriteCSharpString(writer io.Writer, value string) error { | |
| buffer := []byte(value) |
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 UnityEditor; | |
| public class ImageProcessor : AssetPostprocessor | |
| { | |
| private void OnPreprocessTexture() | |
| { | |
| var importer = assetImporter as TextureImporter; | |
| if (null == importer) | |
| { | |
| return; |
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
| function get_timezone() | |
| local now = os.time() | |
| return os.difftime(now, os.time(os.date("!*t", now))) | |
| end | |
| local epoch = get_timezone() | |
| function parse_json_date(json_date) | |
| local year, month, day, hour, minute, seconds, offsetsign, offsethour, offsetmin = json_date:match("(%d+)%-(%d+)%-(%d+)%a(%d+)%:(%d+)%:([%d%.]+)([Z%+%- ])(%d?%d?)%:?(%d?%d?)") | |
| local timestamp = os.time{year = year, month = month, day = day, hour = hour, min = minute, sec = math.floor(seconds)} + epoch | |
| local offset = 0 |