This file contains 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
// THIS IS ONLY A PORTION OF THE FILE | |
// WILL NOT COMPILE OUT OF THE BOX! | |
void OrthogonalizeTangent (TangentInfo& tangentInfo, Vector3f normalf, Vector4f& outputTangent) | |
{ | |
TangentInfo::Vector3d normal = { normalf.x, normalf.y, normalf.z }; | |
TangentInfo::Vector3d tangent = tangentInfo.tangent; | |
TangentInfo::Vector3d binormal = tangentInfo.binormal; |
This file contains 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
// Credit to damien_oconnell from http://forum.unity3d.com/threads/39513-Click-drag-camera-movement | |
// for using the mouse displacement for calculating the amount of camera movement and panning code. | |
using UnityEngine; | |
using System.Collections; | |
public class MoveCamera : MonoBehaviour | |
{ | |
// | |
// VARIABLES |
This file contains 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; | |
using System.Collections.Generic; | |
using UnityEditor; | |
using UnityEngine; | |
using Object = UnityEngine.Object; | |
namespace Swing.Editor | |
{ | |
public class EditorCoroutine |
This file contains 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.Generic; | |
public class HighFreqInput : MonoBehaviour { | |
struct InputEvent { | |
public readonly bool keyUp; | |
public readonly KeyCode keyCode; | |
public readonly int frame; | |
public readonly float time; |
This file contains 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
/** | |
* Input Module to use the new unity ui with multitouch from https://github.com/TouchScript | |
* Install TouchScript in your unity project, then add an EventSystem and replace the InputModules by this one. | |
* | |
* | |
* Basically modified TouchInputModule from | |
* https://bitbucket.org/Unity-Technologies/ui/src/5fc21bb4ecf4b40ff6630057edaa070252909b2e/UnityEngine.UI/EventSystem/InputModules/TouchInputModule.cs?at=4.6 | |
* and changing ProcessTouchEvent to take events from TouchScript | |
* | |
* Got the TouchScript stuff from |
This file contains 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 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; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class CircleText : BaseVertexEffect | |
{ | |
public int radius = 50; | |
public float spaceCoff = 1f; |
This file contains 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
UNITY_MATRIX_IT_MV[0].xyz = ??? | |
UNITY_MATRIX_IT_MV[1].xyz = Camera Up | |
UNITY_MATRIX_IT_MV[2].xyz = Camera Forward | |
float3 forward = -normalize(UNITY_MATRIX_V._m20_m21_m22); | |
float3 up = normalize(UNITY_MATRIX_V._m10_m11_m12); | |
float3 right = normalize(UNITY_MATRIX_V._m00_m01_m02); | |
float3 cameraUp = unity_CameraInvProjection[1].xyz; | |
float3 camRight = cross(unity_CameraInvProjection[2].xyz, cameraUp); |
This file contains 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
For Unity 2019 plase use this | |
==> https://github.com/rutcreate/TextMesh-Pro-Thai | |
==> 90% of font need to edit for some character | |
==> or add | |
==> "com.unity.textmeshpro": "https://github.com/rutcreate/TextMesh-Pro-Thai.git" | |
==> To manifest.json in your project | |
==> Unity5 or lower | |
Manual Patch |
This file contains 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; | |
using UnityEngine.Playables; | |
using UnityEngine.Timeline; | |
public class AlphaBehaviour : PlayableBehaviour | |
{ | |
public float Alpha; | |
} |
OlderNewer