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 EndlessTiles : MonoBehaviour | |
{ | |
[SerializeField] protected Tile m_TilePrefab; | |
[SerializeField] protected Material[] m_Materials; | |
[SerializeField] protected Material m_TouchedMaterial; | |
protected Tile[,] m_Tiles; |
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; | |
[CustomEditor(typeof(Font))] | |
public class FontEditor : Editor | |
{ | |
Font m_Font; | |
static bool m_TilingControlsVisible; |
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
class ReferenceRefTest | |
{ | |
class C | |
{ | |
public int i; | |
public C(int i) {this.i = i;} | |
} | |
static int Main() |
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
// By Richard Fine | |
[MenuItem("Tools/Find missing scripts")] | |
public static void FindMissingScripts() | |
{ | |
var allTransforms = FindSceneObjectsOfType(typeof (Transform)); | |
foreach(Transform t in allTransforms) | |
{ | |
if(t.gameObject.GetComponents<Component>().Any(c => !c)) | |
Debug.LogError("One or more scripts on " + t.gameObject + " is missing.", t.gameObject); |
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
public Triangulator(Vector3[] points) | |
{ | |
m_points = points.Select(vertex => new Vector2(vertex.x, vertex.y)).ToList(); | |
} |
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
#pragma strict | |
var whatever = 0; | |
function Start() | |
{ | |
Whatever = 1; | |
Debug.Log(Whatever); | |
} |
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
%YAML 1.1 | |
%TAG !u! tag:unity3d.com,2011: | |
--- !u!13 &1 | |
InputManager: | |
m_ObjectHideFlags: 0 | |
m_Axes: | |
- serializedVersion: 3 | |
m_Name: Horizontal | |
descriptiveName: | |
descriptiveNegativeName: |
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
protected Bounds OnGetFrameBounds() | |
{ | |
Bounds bounds; | |
if(m_SelectedWaypoints.Count > 0) | |
{ | |
// Focus the selected waypoints: | |
bounds = new Bounds(m_Path.transform.TransformPoint(m_SelectedWaypoints.First().position), Vector3.zero); | |
foreach(var waypoint in m_SelectedWaypoints.Skip(1)) |
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.Linq; | |
[CustomEditor(typeof(SplineMesh))] | |
public class SplineMeshEditor : Editor | |
{ | |
protected SplineMesh m_Target; | |
protected MeshFilter m_MeshFilter; |
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.Generic; | |
using System.Linq; | |
public class SplineMesh : MonoBehaviour | |
{ | |
[System.Serializable] | |
public class Node | |
{ | |
public Vector3 position; |