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.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using UnityEngine; | |
/* | |
Possible effects to model: | |
Attenuation of taps | |
- Apparent surface area |
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
import math | |
import random; | |
from sympy import * | |
''' | |
=== Toying with Benford's law === | |
https://en.wikipedia.org/wiki/Benford's_law | |
Introductory video by Numberphile: www.youtube.com/watch?v=XXjlR2OK1kM |
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 "Unlit/Outline" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
_OutlineColor("Outline Color", Color) = (0,0,0,1) | |
_OutlineThickness("Outline Thickness", Range(0,1)) = 0.03 | |
} | |
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 System.Collections.Generic; | |
using UnityEngine; | |
public class ColliderMovingCost : MonoBehaviour { | |
[SerializeField] private bool _useKinematicRigidbodies = true; | |
[SerializeField] private bool _moveCollidersUsingRigidbody = false; | |
private List<Transform> _colliderTransforms; | |
private List<Rigidbody> _colliderBodies; |
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 Unity.Mathematics; | |
public struct Transform2D { | |
public float2 position; | |
public float2 velocity; | |
} | |
public class LookAt2dWithoutTrig : MonoBehaviour | |
{ |
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
// C# side | |
public class LineRenderer : MonoBehaviour { | |
[SerializeField] private Camera _camera; | |
[SerializeField] private Material _lineMaterial; | |
private NativeArray<float3> _linePoints; | |
private ComputeBuffer _linePointBuffer; | |
private ComputeBuffer _lineIndexBuffer; | |
private int _lineCount; |
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 Unity.Collections; | |
using Unity.Mathematics; | |
using UnityEngine; | |
using Unity.Collections.LowLevel.Unsafe; | |
/* | |
Utility for memcopying data from native to managed containers and vice versa. | |
Todo: Is it possible to generic memcopy implementations, where Source, Dest : struct? | |
If not, you know what to do: *** code generation *** |
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 Unity.Collections; | |
using Unity.Audio; | |
using Unity.Mathematics; | |
using Unity.Burst; | |
using System.Collections; | |
/* | |
For allocations inside AudioKernels, use Allocator.AudioKernel | |
*/ |
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
/* | |
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-7.0/pattern-matching | |
Cool proposal. Here I do a quick rewrite using the Unity ~C#6 syntax: | |
*/ | |
namespace Algebra { | |
public abstract class Expr { } |
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
------------------------------------------------------------------------------- | |
Build Report | |
Uncompressed usage by category: | |
Textures 2165.0 mb 19.4% | |
Meshes 7832.8 mb 70.2% | |
Animations 1.1 mb 0.0% | |
Sounds 148.2 mb 1.3% | |
Shaders 58.7 mb 0.5% | |
Other Assets 676.7 mb 6.1% | |
Levels 218.6 mb 2.0% |
NewerOlder