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 UnityEngine; | |
public class MeshDestroy : MonoBehaviour | |
{ | |
private bool edgeSet = false; | |
private Vector3 edgeVertex = Vector3.zero; | |
private Vector2 edgeUV = Vector2.zero; |
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
/* | |
Set this on an empty game object positioned at (0,0,0) and attach your active camera. | |
The script only runs on mobile devices or the remote app. | |
*/ | |
using UnityEngine; | |
class ScrollAndPinch : MonoBehaviour |
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
static class Math3D | |
{ | |
private static System.Random rand = new System.Random(); | |
public static float DistanceToLine(Ray ray, Vector3 point) | |
{ | |
//see:http://answers.unity3d.com/questions/62644/distance-between-a-ray-and-a-point.html | |
return Vector3.Cross(ray.direction, point - ray.origin).magnitude; | |
} |
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; | |
namespace Ditzelgames | |
{ | |
public static class PhysicsHelper | |
{ | |
public static void ApplyForceToReachVelocity(Rigidbody rigidbody, Vector3 velocity, float force = 1, ForceMode mode = ForceMode.Force) | |
{ | |
if (force == 0 || velocity.magnitude == 0) |
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; | |
namespace DitzeGames.Effects | |
{ | |
/// <summary> | |
/// Camera Effects | |
/// </summary> | |
public class CameraEffects : MonoBehaviour | |
{ |
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; | |
public class DistanceJoint3D : MonoBehaviour { | |
public Transform ConnectedRigidbody; | |
public bool DetermineDistanceOnStart = true; | |
public float Distance; | |
public float Spring = 0.1f; | |
public float Damper = 5f; |
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; | |
public class TouchToShoot : MonoBehaviour { | |
public Material hitMaterial; | |
// Use this for initialization | |
void Start () { | |
} |
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 UnityEngine; | |
using UnityEngine.Profiling; | |
public class KdTree<T> : IEnumerable<T>, IEnumerable where T : Component | |
{ | |
protected KdNode _root; | |
protected KdNode _last; |
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; | |
public class HappyCube : MonoBehaviour { | |
MeshFilter mFilter; | |
Mesh Mesh; | |
public float UpDownFactor = 0.1f; | |
public float UpDownSpeed = 6f; | |
public float LeftFactor = 0.3f; |
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.Collections; | |
using System.IO; | |
using UnityEngine; | |
public class Paintable : MonoBehaviour { | |
public GameObject Brush; | |
public float BrushSize = 0.1f; | |
public RenderTexture RTexture; |
NewerOlder