Add project files.
This commit is contained in:
34
Assets/Cryville/Common/Unity/CallHelper.cs
Normal file
34
Assets/Cryville/Common/Unity/CallHelper.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace Cryville.Common.Unity {
|
||||
static class CallHelper {
|
||||
public static bool HasFlag(this Enum obj, Enum flag) {
|
||||
ulong num = Convert.ToUInt64(flag);
|
||||
ulong num2 = Convert.ToUInt64(obj);
|
||||
return (num2 & num) == num;
|
||||
}
|
||||
|
||||
public static void ShowException(Exception ex) {
|
||||
ShowMessageBox(ex.ToString());
|
||||
}
|
||||
|
||||
public static void ShowMessageBox(string message) {
|
||||
GameObject.Instantiate<GameObject>(Resources.Load<GameObject>("Common/Popup")).GetComponent<Popup>().Message = message;
|
||||
}
|
||||
|
||||
public static void Purge(Transform obj) {
|
||||
foreach (Transform i in obj)
|
||||
GameObject.Destroy(i.gameObject);
|
||||
}
|
||||
|
||||
/*public static void DownloadAndUnzip(string url, FileInfo file) {
|
||||
using (DownloadDialog d = new DownloadDialog()) {
|
||||
d.Download(url, file);
|
||||
}
|
||||
using (ZipFile z = new ZipFile(file.FullName)) {
|
||||
z.ExtractAll(file.DirectoryName, ExtractExistingFileAction.OverwriteSilently);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user