Skip to content

Instantly share code, notes, and snippets.

View ginxx009's full-sized avatar
🏠
Working from home

Ginx009 ginxx009

🏠
Working from home
View GitHub Profile
@ginxx009
ginxx009 / Decrypt.cs
Created June 21, 2018 16:22
Encryption & Decryption MD5 C#
private void btnDecrypt_Click(object sender, EventArgs e)
{
byte[] data = Convert.FromBase64String(textBox4.Text); // decrypt the incrypted text
using (MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider())
{
byte[] keys = md5.ComputeHash(UTF8Encoding.UTF8.GetBytes(hash));
using (TripleDESCryptoServiceProvider tripDes = new TripleDESCryptoServiceProvider() { Key = keys, Mode = CipherMode.ECB, Padding = PaddingMode.PKCS7 })
{
ICryptoTransform transform = tripDes.CreateDecryptor();
byte[] results = transform.TransformFinalBlock(data, 0, data.Length);
using System;
using System.Collections;
using UnityEngine;
using PaulKevin;
public class Baccarat_BetBoard : MonoBehaviour
{
//[SerializeField] protected GameObject[] prefab_big_road = null;
//[SerializeField] Transform[] pos_big_road = null;
using UnityEngine;
using System;
using System.IO;
using LitJson;
public class StreetUtility
{
// Parsing 1 (Unity default parser).
public static string ToJson<T>(T requestObject)
@ginxx009
ginxx009 / aesalg.js
Last active February 9, 2018 06:31
Rijndael's encryption algorith for AES
// do encrytion
function aes_encrypt(message,crypt_key)
{
var w = new Array( 44 ); // subkey information
var state = new Array( 16 ); // working state
var round;
msg=get_value(message,true);
key=get_value(crypt_key,false);
@ginxx009
ginxx009 / EditorCameraControls.cs
Created January 12, 2018 02:15
OnBecameVisible
using UnityEngine;
using UnityEditor;
public class EditorCameraControls : EditorWindow
{
[MenuItem("Tools/EditorCameraControls")]
private static void Init()
{
GetWindow<EditorCameraControls>();
@ginxx009
ginxx009 / PopUpMenu.cs
Created January 12, 2018 01:53
Saving a settings
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MobileOpt : MonoBehaviour {
[SerializeField]
Button openButton, closeButton;
@ginxx009
ginxx009 / MouseSwipe.cs
Created January 8, 2018 07:32
Swipe in all directions Touch and Mouse
//inside class
Vector2 firstPressPos;
Vector2 secondPressPos;
Vector2 currentSwipe;
public void Swipe()
{
if(Input.GetMouseButtonDown(0))
{
//save began touch 2d point
@ginxx009
ginxx009 / PlayerPrefs.cs
Created January 5, 2018 03:13
This class works like a hash table, allowing you to store key-value pairs. The disadvantage of the built-in PlayerPrefs class is that it’s really slow on iOS and even slower on Android. This version of the PlayerPrefs class is allowing faster saving of tuning parameters in the prototypes. saving 300+ records almost instantly on on the same device.
using UnityEngine;
using System;
using System.Collections;
using System.IO;
using System.Text;
using System.Security.Cryptography;
namespace PreviewLabs
{
public static class PlayerPrefs
class CommandLine{
static string CurrentDate = "";
const string szReleasePath = "../RELEASE/ANDROID/GOOGLEPLAY/";
private static string MoveResource(string szOrigin, string szDest){
string szApplicationDataPath = Application.dataPath;
if(szOrigin.Contains(szApplicationDataPath)){
//ANDROID PLATFORM
string json = null;
string full_path = Application.streamingAssetsPath + "filename";
// Android only use WWW to read file
WWW reader = new WWW(full_path);
//wait until the download is done
while (!reader.isDone){}
json = reader.text;