I hereby claim:
- I am arashrasoulzadeh on github.
- I am arashrasoulzadeh (https://keybase.io/arashrasoulzadeh) on keybase.
- I have a public key ASDRfloLZ34yvBC2hKOpiPrQzAue-uCNqoVkp1bhzZqjWQo
To claim this, I am signing this object:
///<summary> | |
///<para>StringBuilder with array</para> | |
///</summary> | |
public static String BuildString(System.Object[] array) | |
{ | |
StringBuilder sb = new StringBuilder(); | |
for (int i = 0; i < array.Length; i++) | |
{ | |
sb.Append(array[i]); | |
} |
String s = BuildString(new System.Object[] { 1,"test",2,true }); | |
//out put is : 1test2true |
public static IEnumerator WaitForRealSeconds(float time) | |
{ | |
float start = Time.realtimeSinceStartup; | |
while (Time.realtimeSinceStartup < start + time) | |
{ | |
yield return null; | |
} | |
} |
yield return StartCoroutine (WaitForRealSeconds (0.5f)); | |
//will be done after 0.5 seconds |
public static Color hexToColor(string hex) | |
{ | |
hex = hex.Replace("0x", "");//in case the string is formatted 0xFFFFFF | |
hex = hex.Replace("#", "");//in case the string is formatted #FFFFFF | |
byte a = 255;//assume fully visible unless specified in hex | |
byte r = byte.Parse(hex.Substring(0, 2), System.Globalization.NumberStyles.HexNumber); | |
byte g = byte.Parse(hex.Substring(2, 2), System.Globalization.NumberStyles.HexNumber); | |
byte b = byte.Parse(hex.Substring(4, 2), System.Globalization.NumberStyles.HexNumber); | |
//Only use alpha if the string has enough characters | |
if (hex.Length == 8) |
///<summary> | |
///<para>returns unique id of device </para> | |
///</summary> | |
public static String returnUniqueID (bool base64) | |
{ | |
if (base64) { | |
username = UnityEngine.SystemInfo.deviceUniqueIdentifier; | |
byte[] bytesToEncode = System.Text.Encoding.UTF8.GetBytes (username); | |
return Convert.ToBase64String (bytesToEncode); | |
} else { |
public bool uiTouch (GameObject go) | |
{ | |
if (go.GetComponent<SpriteRenderer> () != null) | |
if (Input.GetButtonUp ("Fire1") && go.activeInHierarchy) { | |
//Gets the world position of the mouse on the screen | |
Vector2 mousePosition = Camera.main.ScreenToWorldPoint (Input.mousePosition); | |
//Checks whether the mouse is over the sprite | |
bool overSprite = go.GetComponent<SpriteRenderer> ().bounds.Contains (mousePosition); |
is_string($json); |
I hereby claim:
To claim this, I am signing this object:
<?php | |
namespace arashrasoulzadeh\auth\src\traits; | |
use arashrasoulzadeh\auth\src\model\UserAuthMetas; | |
trait UserMetaTrait | |
{ | |
/** @var array |