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 void LoadConfig() | |
{ | |
foreach (Type type in ConfigList.AllConfigTypeList) | |
{ | |
string path = "../../Resources/Config/" + type.Name.Replace("Config", ".bytes"); | |
using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.None)) | |
{ | |
byte[] binary = new byte[fs.Length]; | |
fs.Read(binary, 0, Convert.ToInt32(fs.Length)); | |
m_configDic.Add(type, BinaryParse(binary, type)); |
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 ConfigDataBase CreateConfigData(Type configType) | |
{ | |
var configData = Activator.CreateInstance(configType) as ConfigDataBase; | |
return configData; | |
} |
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 Param GetParam(string jsonPath) | |
{ | |
UnityEngine.Object asset = Resources.Load(jsonPath); | |
TextAsset textAsset = (TextAsset)asset; | |
string json = textAsset.text; | |
JsonReader jsonReader = new JsonReader(json); | |
JsonData jsonData = JsonMapper.ToObject(jsonReader); | |
Param param = new Param(); |
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 class Name | |
{ | |
#region Field | |
public readonly string FirstName; | |
public readonly string LastName; | |
#endregion | |
public Name(string firstName, string lastName) |
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 class CustomYieldInstructionSample : MonoBehaviour | |
{ | |
IEnumerator TheCoroutine() | |
{ | |
TheLock theLock = new TheLock(); | |
yield return new WaitTheFinish(theLock.GetLockState); | |
} | |
} | |
public class WaitTheFinish : CustomYieldInstruction |
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 delegate void LogCallback(string str, Color color); | |
private void LogHandler(string str, Color color) | |
{ | |
if (LogRichTextBox.InvokeRequired) | |
{ | |
LogCallback logCallback = LogCallbackFunction; | |
Invoke(logCallback, new object[] {str, color}); | |
} |
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 UnityEngine; | |
using UnityEngine.Events; | |
using UnityEngine.EventSystems; | |
using UnityEngine.UI; | |
public class UnityEventSample : Graphic, IPointerUpHandler, IPointerDownHandler | |
{ | |
[Serializable] | |
public class EventNone : UnityEvent |
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 explicit operator UnityEngine.Vector3(NanoFramework.UnityForServer.DataStructure.Vector3 v) | |
{ | |
return new UnityEngine.Vector3(v.x, v.y, v.z); | |
} |
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
/// <summary> | |
/// Data Matrix Matching Check | |
/// </summary> | |
/// <param name="u1"></param> | |
/// <param name="u2"></param> | |
/// <param name="num">Maxdiff</param> | |
public static bool Match(ulong u1, ulong u2, byte num) | |
{ | |
for (u1 ^= u2; 0 != u1 && 0 != num; num--) | |
{ |
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
/// <summary> | |
/// Data Matrix Rotating | |
/// </summary> | |
/// <param name="number">Original Data</param> | |
/// <returns>Four directions of the number, the original data in the final.</returns> | |
public static ulong[] GetRotatedNumbers(ulong number) | |
{ | |
ulong[] ulongs = new ulong[4]; | |
ulongs[3] = number; | |
for (int t = 0; t < 3; ++t) |
OlderNewer