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
| 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
| 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
| <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
| 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
| using UnityEngine.Events; | |
| //will be displayed in editor | |
| public UnityEvent yourCustomEvent; | |
| public void Foo() { | |
| // Trigger the event! | |
| yourCustomEvent.Invoke(); | |
| } |
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.Networking; | |
| /// <summary> | |
| /// Opens external application to send an email | |
| /// </summary> | |
| /// <param name="email">Email address</param> | |
| /// <param name="subject">Subject.</param> | |
| /// <param name="body">Body. E.g "My Body\r\nFull of non-escaped chars"</param> | |
| void SendEmail(string email, string subject, string body) | |
| { |
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
| #if UNITY_EDITOR | |
| Debug.unityLogger.logEnabled = true; | |
| #else | |
| Debug.unityLogger.logEnabled = false; | |
| #endif |
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 System; | |
| using System.Collections.Generic; | |
| class WeightedRandomBag<T> { | |
| private struct Entry { | |
| public double accumulatedWeight; | |
| public T item; | |
| } |
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 System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| /// <summary> | |
| /// Used to set Sorting Layer for 3D meshes, so they can Z-sort | |
| /// correctly when used with 2D Sprites. | |
| /// </summary> | |
| public class OverrideSortingLayer : MonoBehaviour | |
| { |