This file contains 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
// Arowx.com 2013 - free to use and improve! | |
using UnityEngine; | |
using System.Collections; | |
public class JoystickTester : MonoBehaviour { | |
public TextMesh joysticks; | |
public TextMesh[] inputText; | |
public TextMesh[] buttonText; |
This file contains 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
adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG |
This file contains 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
var someDate = new Date("Wed Jun 26 2019 09:08:32 GMT+0100") | |
result = `${String(someDate.getHours()).padStart(2,"0")}:${String(someDate.getMinutes()).padStart(2,"0")}` // returns "09:08" |
This file contains 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 UnityEditor; | |
using UnityEditor.Experimental.AssetImporters; | |
using UnityEngine; | |
using System.Reflection; | |
using System; | |
using System.Collections; | |
using System.Linq; | |
using Object = UnityEngine.Object; | |
using System.Collections.Generic; |
This file contains 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 UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
public class ColliderToFit : MonoBehaviour { | |
[MenuItem("My Tools/BoxCollider/Fit to Children")] | |
static void FitToChildren() { | |
foreach (GameObject rootGameObject in Selection.gameObjects) { | |
if (!(rootGameObject.collider is BoxCollider)) |
This file contains 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
bullet.transform.rotation = Quaternion.Euler( 90, 0, 0 ) * Quaternion.LookAt( target.transform.position - bullet.transform.position ) ; | |
// OR | |
//bullet.transform.rotation = Quaternion.LookAt( target.transform.position - bullet.transform.position ) * Quaternion.Euler( 90, 0, 0 ) ; |
This file contains 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
Shader "Custom/Stencilled" { | |
Properties { | |
_StencilMask("Stencil mask", Int) = 0 | |
_Color ("Color", Color) = (1,1,1,1) | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
_Glossiness ("Smoothness", Range(0,1)) = 0.5 | |
_Metallic ("Metallic", Range(0,1)) = 0.0 | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } |
This file contains 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
Shader "Custom/StencilMask" { | |
Properties { | |
_StencilMask("Stencil mask", Int) = 0 | |
} | |
SubShader { | |
Tags { | |
"RenderType" = "Opaque" | |
"Queue" = "Geometry-100" | |
} |
This file contains 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 LookAtPoint2d(Vector2 targetPoint, int degreesCompensation=0) | |
{ | |
Vector3 dir = (targetPoint - (Vector2)transform.position).normalized; | |
float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg - degreesCompensation; | |
torsoAnimator.gameObject.transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward); | |
} |
This file contains 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
# coding=utf-8 | |
from locust.clients import HttpSession | |
from locust import HttpLocust | |
class LoggedHttpSession(HttpSession): | |
def __init__(self, base_url, debug=True, *args, **kwargs): | |
""" | |
Custom HttpSession client that saves all request and responses data for debugging | |
""" | |
self.debug = debug |