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
| int epoch = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; |
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
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
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
| adb logcat -s Unity PackageManager dalvikvm DEBUG |
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 UnityEngine; | |
| using UnityEngine.Events; | |
| [System.Serializable] | |
| public class TriggerEntered2dReraised : UnityEvent<Collider2D> | |
| { | |
| } | |
| public class ReraiseTriggerEnterEvent : MonoBehaviour | |
| { |
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
| from locust import TaskSet, task | |
| class UserBehaviour(TaskSet): | |
| @task | |
| def someTask(self): | |
| filename="some/file.jpg" | |
| with open(filename, 'rb') as img: | |
| self.client.post( | |
| "/some/url", | |
| data={ |
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
| # 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 |
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 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 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
| Shader "Custom/StencilMask" { | |
| Properties { | |
| _StencilMask("Stencil mask", Int) = 0 | |
| } | |
| SubShader { | |
| Tags { | |
| "RenderType" = "Opaque" | |
| "Queue" = "Geometry-100" | |
| } |
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
| 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 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
| 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 ) ; |