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 UnityEditor; | |
| using System.Collections; | |
| using System.IO; | |
| using System.Text; | |
| public class ObjExporterScript | |
| { | |
| private static int StartIndex = 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
| import Foundation | |
| import RxSwift | |
| class Ref<E> { | |
| private let value : Variable<E> | |
| private let q = dispatch_queue_create("net.chrisfarber.Ref<\(E.self)>", DISPATCH_QUEUE_SERIAL) | |
| init(i:E) { | |
| value = Variable(i) | |
| } |
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; | |
| [RequireComponent (typeof(Rigidbody))] | |
| public class PhysicsFollower : MonoBehaviour | |
| { | |
| public Transform target; | |
| Rigidbody rb; |
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 "Example/Decal" { | |
| Properties { | |
| _MainTex ("Base (RGB)", 2D) = "white" {} | |
| } | |
| SubShader { | |
| Tags { "RenderType"="Opaque" "Queue"="Geometry+1" "ForceNoShadowCasting"="True" } | |
| LOD 200 | |
| Offset -1, -1 | |
| CGPROGRAM |
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
| /** | |
| * Change the current displayed fragment by a new one. | |
| * - if the fragment is in backstack, it will pop it | |
| * - if the fragment is already displayed (trying to change the fragment with the same), it will not do anything | |
| * | |
| * @param frag the new fragment to display | |
| * @param saveInBackstack if we want the fragment to be in backstack | |
| * @param animate if we want a nice animation or not | |
| */ |
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/NormalMapShader" { | |
| Properties { | |
| _Color ("Color", Color) = (1,1,1,1) | |
| _LightColor("LightColor", Color) = (1,1,1,1) | |
| _MainTex("Albedo (RGB)", 2D) = "white" {} | |
| _SpecularMap("SpecularMap (RGB)", 2D) = "white" {} | |
| _NormalMap("NormalMap", 2D) = "white" {} | |
| _MainLightPosition("MainLightPosition", Vector) = (0,0,0,0) | |
| } | |
| SubShader{ |
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.Linq; | |
| public class TapCharacterController : MonoBehaviour | |
| { | |
| public delegate void MotionEventHandler (GameObject sender); | |
| public delegate void TargetHandler (GameObject sender,GameObject target); |
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 FlyCamera : MonoBehaviour { | |
| /* | |
| Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care. | |
| Converted to C# 27-02-13 - no credit wanted. | |
| Simple flycam I made, since I couldn't find any others made public. | |
| Made simple to use (drag and drop, done) for regular keyboard layout |
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; | |
| public static class ConfigurableJointExtensions | |
| { | |
| /// <summary> | |
| /// Sets a joint's targetRotation to match a given local rotation. | |
| /// The joint transform's local rotation must be cached on Start and passed into this method. | |
| /// </summary> | |
| public static void SetTargetRotationLocal (this ConfigurableJoint joint, Quaternion targetLocalRotation, Quaternion startLocalRotation) | |
| { |