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; | |
// This component can emit particles into one or more ParticleEmitters. As several ParticleInjectors can emit to a shared set of | |
// ParticleEmitters, this allows you to save draw calls by having fewer separate particle systems. | |
// | |
// Note that when a ParticleEmitter's Simulate In World Space checkbox is off, it's OK to attach ParticleInjectors to separate | |
// hierarchies and move them independently. If it's turned on, the ParticleInjectors really need to be children of the emitter | |
// for the emission behaviour to make sense. |
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 override void FixedUpdate() | |
{ | |
if(m_Controls != null) | |
{ | |
float turnFactor = Mathf.Lerp(1.0f, 0.5f, m_Controls.thrust); | |
rigidbody.AddRelativeTorque(Vector3.right * m_Controls.pitch * m_PitchFactor * turnFactor); | |
rigidbody.AddRelativeTorque(Vector3.forward * m_Controls.roll * m_RollFactor * turnFactor); | |
rigidbody.AddRelativeTorque(Vector3.up * m_Controls.yaw * m_YawFactor * turnFactor); |
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.Collections.Generic; | |
using System.Linq; | |
[CustomEditor(typeof(Path))] | |
public class PathEditor : Editor | |
{ | |
protected Path m_Path; |
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
// Upgrade NOTE: replaced 'PositionFog()' with multiply of UNITY_MATRIX_MVP by position | |
// Upgrade NOTE: replaced 'V2F_POS_FOG' with 'float4 pos : SV_POSITION' | |
// Upgrade NOTE: replaced 'glstate.matrix.modelview[0]' with 'UNITY_MATRIX_MV' | |
// By Daniel Brauer, with minor changes to make it additive. | |
Shader "Particles/Additive Clipsafe" | |
{ | |
Properties |
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; | |
using System.Linq; | |
[AddComponentMenu("Paths/Path")] | |
public class Path : MonoBehaviour, IEnumerable<Path.Segment> | |
{ | |
[System.Serializable] | |
public class Waypoint : System.ICloneable |
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; | |
[AddComponentMenu("Paths/Path Test")] | |
public class PathTest : MonoBehaviour | |
{ | |
public Transform[] m_Transforms; | |
public int m_Divisions; | |
public float m_Tension; | |
public float m_Bias; |
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; | |
namespace Testbed | |
{ | |
static class Extensions | |
{ | |
public static T ElementFromWrappedIndex<T>(this List<T> list, int i) | |
{ | |
return list[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
Shader "Mine/Unlit Alpha" | |
{ | |
Properties | |
{ | |
_Color ("Tint", Color) = (1,1,1,1) | |
_MainTex ("Texture", 2D) = "white" {} | |
} | |
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
Shader "Mine/Spatial Cutoff Test" | |
{ | |
Properties | |
{ | |
_Color ("Main Color", Color) = (1,1,1,1) | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_Cutoff ("Cutoff", Float) = 1 | |
} | |
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; | |
public class StickOnContact : MonoBehaviour | |
{ | |
public Collider m_Contactor; | |
void OnCollisionEnter(Collision collisionInfo) | |
{ | |
foreach(ContactPoint contact in collisionInfo.contacts) |
OlderNewer