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
[
{
"action": "talk",
"voiceName": "Chipmunks",
"text": "Yo, this is paul kevin. I created a outbound voice API!"
}
]
[
{
"action": "talk",
"voiceName": "Russell",
"text": "Hi, this is paul kevin. I created a outbound voice API!"
}
]
//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;
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)){
@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
@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 / 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 / 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 / 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);
using UnityEngine;
using System;
using System.IO;
using LitJson;
public class StreetUtility
{
// Parsing 1 (Unity default parser).
public static string ToJson<T>(T requestObject)