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; | |
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; | |
/* | |
* 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
// Developed as a part of World of Zero: https://youtu.be/b4utgRuIekk | |
Shader "Custom/RevealingShader" { | |
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 | |
_LightDirection("Light Direction", Vector) = (0,0,1,0) | |
_LightPosition("Light Position", Vector) = (0,0,0,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
// DATA CUBE | |
// Written as a part of World of Zero see: youtube.com/worldofzerodevelopment | |
// for videos on creating this and other fun projects | |
#include <Adafruit_NeoPixel.h> | |
#define PIN 6 | |
#define N_LEDS 240 | |
typedef struct { | |
uint8_t r; |
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; | |
// Written as part of World of Zero | |
// Video available here: https://youtu.be/hmDF9PvMDVw | |
public class Dice : MonoBehaviour | |
{ | |
public SideResults selectedResult; | |
public int selectedVector; |
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
// Developed as part of World of Zero: www.worldofzero.com | |
Shader "Custom/VoxelShader" { | |
Properties { | |
_Color ("Color", Color) = (1,1,1,1) | |
_Texture1("Texture 1 (RGB)", 2D) = "white" {} | |
_Texture2("Texture 2 (RGB)", 2D) = "white" {} | |
_Texture3("Texture 3 (RGB)", 2D) = "white" {} | |
_Texture1Height("Texture 1 Height (R)", 2D) = "black" {} | |
_Texture2Height("Texture 2 Height (R)", 2D) = "black" {} |
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 |