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
| $(document).ajaxSend(function(event, request, settings) | |
| { | |
| console.log('Caught AJAX request!'); | |
| console.log(event); | |
| console.log(request); | |
| console.log(settings); | |
| }); |
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
| // a not-cheap but not-expensive water shader | |
| // decent quality DX9 2012-era water, by Robert Yang (@radiatoryang) | |
| // based on: | |
| // built-in legacy Alpha-Bumped shader | |
| // added cubemap reflection and rimlight stuff | |
| // GlassStainedBumpDistort from Unity glass refraction demo | |
| // http://forum.unity3d.com/threads/grabtexture-uv-correction-in-surface-shader.67742/ | |
| // ... this does NOT have fogging or edge blending (too expensive / annoying?) |
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; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using MoonSharp.Interpreter; | |
| using MoonSharp.Interpreter.Interop; | |
| namespace Playground |
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
| ZigZag-Encoding | |
| --------------- | |
| Maps negative values to positive values while going back and | |
| forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...) | |
| (i >> bitlength-1) ^ (i << 1) | |
| with "i" being the number to be encoded, "^" being | |
| XOR-operation and ">>" would be arithemtic shifting-operation |
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.UI; | |
| /* | |
| Radial Layout Group by Just a Pixel (Danny Goodayle) - http://www.justapixel.co.uk | |
| Copyright (c) 2015 | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
| private static string[] _persistentDataPaths; | |
| public static bool IsDirectoryWritable(string path) { | |
| try { | |
| if (!Directory.Exists(path)) return false; | |
| string file = Path.Combine(path, Path.GetRandomFileName()); | |
| using (FileStream fs = File.Create(file, 1)) {} | |
| File.Delete(file); | |
| return true; | |
| } catch { |
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 System.Collections; | |
| public class QuadTreeTest : MonoBehaviour { | |
| public class TestObject : IQuadTreeObject{ | |
| private Vector3 m_vPosition; | |
| public TestObject(Vector3 position){ | |
| m_vPosition = position; | |
| } | |
| public Vector2 GetPosition(){ |
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 System.Collections; | |
| using System.Collections.Generic; | |
| public class goLevel : MonoBehaviour { | |
| //With the @ before the string, we can split a long string in many lines without getting errors | |
| private string json = @"{ | |
| 'hello':'world', | |
| 'foo':'bar', | |
| 'count':25 |
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
| ///////////////////////////////////////////////////////////////////////////// | |
| // int2 is similar to Vector2, but with integers instead of floats | |
| // Useful for various grid related things. | |
| // | |
| // - Swizzle operators xx/xy/yx/yy | |
| // - Extended arithmetic operators similar to shader data types | |
| // A few examples: | |
| // int2(8,4) / int2(2,4) -> int2(4,1) | |
| // 16 / int2(2,4) -> int2(8,4) | |
| // int2(2,3) * int2(4,5) -> int2(8,15) |
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
| /* | |
| FastList<T> is a System.Collections.Generic.List<T> modification such, that allows to not produce garbage when using foreach. | |
| Useful for old versions of c# runtime (like Mono 2.x), i.e. for Unity. | |
| It implements own instance-type enumerator and caches only one instance of this enumerator inside. | |
| Instance-type enumerator allows to avoid boxing that occurs when foreach converts IEnumerator to IDisposable and calls Dispose(). | |
| (Default List<T> enumerator is value-type (struct), so when foreach converts to IDisposable, boxing occurs and 20 bytes of garbage will be collected.) | |
| Warnings: |