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
| #include "UnityCG.cginc" | |
| #pragma vertex vert | |
| #pragma fragment frag | |
| // in practice: only compile for gles2,gles3,metal | |
| #pragma only_renderers framebufferfetch | |
| struct appdata_t { | |
| float4 vertex : POSITION; | |
| float2 texcoord : TEXCOORD0; | |
| }; |
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
| // Skybox shader that just draws flat texture in the background | |
| Shader "Skybox/Background Texture" | |
| { | |
| Properties | |
| { | |
| _MainTex ("Texture", 2D) = "white" {} | |
| } | |
| SubShader | |
| { | |
| Tags { "Queue"="Background" "RenderType"="Background" "PreviewType"="Skybox" } |
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
| /// <summary> | |
| /// UNet LLAPI Hello World | |
| /// This will establish a connection to a server socket from a client socket, then send serialized data and deserialize it. | |
| /// </summary> | |
| using UnityEngine; | |
| using System.Collections; | |
| using UnityEngine.Networking; | |
| using System.Runtime.Serialization.Formatters.Binary; | |
| using System.IO; |
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
| /* | |
| Implementation of ISynchronizeInvoke for Unity3D game engine. | |
| Can be used to invoke anything on main Unity thread. | |
| ISynchronizeInvoke is used extensively in .NET forms, it's is elegant and quite useful in Unity as well. | |
| I implemented it so i can use it with System.IO.FileSystemWatcher.SynchronizingObject. | |
| help from: http://www.codeproject.com/Articles/12082/A-DelegateQueue-Class | |
| example usage: https://gist.github.com/aeroson/90bf21be3fdc4829e631 | |
| version: aeroson 2017-07-13 (author yyyy-MM-dd) |
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
| float3 PositionToOctahedron(float3 position) | |
| { | |
| // Normalize input position to unit sphere to simplify required ops | |
| float3 P = normalize(position); | |
| // Get octant index | |
| float3 side = P >= 0 ? 1 : 0; | |
| float octant_index = side.x + side.y * 2 + side.z * 4; | |
| // Project onto octahedron face, then onto each x/y plane |
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.IO; | |
| using System.Linq; | |
| using UnityEditor; | |
| using UnityEngine; | |
| public class RemoveEmptyFolders | |
| { | |
| /// <summary> | |
| /// Use this flag to simulate a run, before really deleting any folders. | |
| /// </summary> |
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 simple little editor extension to copy and paste all components | |
| Help from http://answers.unity3d.com/questions/541045/copy-all-components-from-one-character-to-another.html | |
| license: WTFPL (http://www.wtfpl.net/) | |
| author: aeroson | |
| */ | |
| using UnityEngine; | |
| using UnityEditor; |
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 UnityEngine; | |
| /// <summary> | |
| /// Wrapper around Unity's WWW request class. | |
| /// </summary> | |
| public class WWWRequest : IEnumerator | |
| { | |
| /// <summary> | |
| /// The default timeout for requests (in seconds). |
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 UnityEngine.Internal; | |
| using UnityEngine; | |
| using System.Runtime.Serialization; | |
| using System.Xml.Serialization; | |
| /// <summary> | |
| /// Quaternions are used to represent rotations. | |
| /// A custom completely managed implementation of UnityEngine.Quaternion | |
| /// Base is decompiled UnityEngine.Quaternion |
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.IO; | |
| using System.Linq; | |
| using System.Collections.Generic; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| using Ionic.Zip; |