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
public static int Compare<TCompare>(TCompare first, TCompare second) where TCompare : IComparable | |
{ | |
return first.CompareTo(second); | |
} |
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; | |
[RequireComponent(typeof(Rigidbody2D))] | |
public class FallingBox : MonoBehaviour { | |
public float width = 1; | |
private new Rigidbody2D rigidbody; | |
private RaycastHit2D hit; | |
public Transform origin; |
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.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace DiningPhilosophers | |
{ | |
class Program |
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.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
// The change problem :D | |
namespace DynamicProgramming | |
{ |
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; | |
namespace CSharp7PatternMatching | |
{ | |
// Built for World of Zero: https://youtu.be/PQucU3VFiBA | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
for (int i = 1; i < 100; ++i) |
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.Collections.Generic; | |
using UnityEngine; | |
// Creates a cached object pool for reduced memory thrashing. | |
// Developed as a part of World of Zero, an interactive programming YouTube channel: youtube.com/worldofzerodevelopment | |
public class GenericObjectPool : MonoBehaviour | |
{ | |
public int count; | |
public GameObject prefab; |
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.Collections.Generic; | |
using UnityEngine; | |
/* | |
* Construct a bridge as a tracked object moves across it. | |
* Created as a part of World of Zero | |
* See it in action here: https://youtu.be/GaQBLD7bGCM | |
*/ | |
public class BridgeBuilder : 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
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject' | |
Shader "Custom/TriPlanarTesselatedShader" { | |
Properties { | |
_Color ("Color", Color) = (1,1,1,1) | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
_Glossiness ("Smoothness", Range(0,1)) = 0.5 | |
_Metallic ("Metallic", Range(0,1)) = 0.0 | |
_Displacement("Displacement", Range(0, 1.0)) = 0.3 | |
_EdgeLength("Edge length", Range(2,50)) = 5 |
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.Collections.Generic; | |
using UnityEngine; | |
public class GrassPhysics : MonoBehaviour | |
{ | |
[HideInInspector] public ComputeShader calculationEngine; | |
public Texture2D initialInput; | |
public Texture2D springynessMap; |
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
// Shader developed for the Transformation Matrices Shader video on World of Zero. | |
// https://www.youtube.com/watch?v=VzhxginBhdc | |
// Developed for Boxes/Cubes but should work anywhere | |
Shader "Custom/FancyBoxShader" { | |
Properties { | |
_Color ("Color", Color) = (1,1,1,1) | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
_Glossiness ("Smoothness", Range(0,1)) = 0.5 | |
_Metallic ("Metallic", Range(0,1)) = 0.0 | |
_OriginOffset ("Offset", Float) = 0.0 |
OlderNewer