Skip to content

Instantly share code, notes, and snippets.

View andybak's full-sized avatar

Andy Baker andybak

View GitHub Profile
Isohedral Tiling Wallpaper Group Tile
IH1 p1 Hexagon
IH2 pg Hexagon
IH3 pg Hexagon
IH4 p2 Hexagon
IH5 pgg Hexagon
IH6 pgg Hexagon
IH7 p3 Hexagon
IH8 p2 Hexagon
IH9 pgg Hexagon
@andybak
andybak / MaterialGradientDrawer.cs
Created March 8, 2021 08:47 — forked from totallyRonja/MaterialGradientDrawer.cs
A Material Property Drawer for the [Gradient] attribute which lets you edit gradients and adds them to the shader as textures. More information here: https://twitter.com/totallyRonja/status/1368704187580682240
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
public class MaterialGradientDrawer : MaterialPropertyDrawer {
private static Dictionary<(int, string), Gradient> knownGradients = new Dictionary<(int, string), Gradient>();
// Standard shader with triplanar mapping
// https://github.com/keijiro/StandardTriplanar
Shader "Standard Triplanar Transparent"
{
Properties
{
_Color("", Color) = (1, 1, 1, 1)
_MainTex("", 2D) = "white" {}
using UnityEngine;
public class SetTrackOffsetPositionOnRelease : MonoBehaviour
{
public GameObject feet;
public Transform target;
void OnEnable()
{
MoveToTarget();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
using TiltBrush;
using UnityEditor;
using UnityEngine;
using Valve.Newtonsoft.Json.Utilities;
@andybak
andybak / FooTool.cs
Last active February 11, 2021 18:14
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Conway;
using UnityEngine;
using Random = System.Random;
namespace TiltBrush.AndyB
{
// Not working.
// Creates a batch that appears to have geometry but nothing is visible in the scene
override public void UpdateTool()
{
base.UpdateTool();
Transform rAttachPoint = InputManager.Brush.Geometry.ToolAttachPoint;
Vector3 pos = rAttachPoint.position;
Quaternion rot = rAttachPoint.rotation;
// Untested Tilt Brush script
// Try running this in a tool script.
// Gleaned from ParametricStrokeCreator.cs and PointerManager.cs
var xfPointer_CS = App.Scene.ActiveCanvas.AsCanvas[rAttachPoint];
ParametricStrokeCreator currentCreator = new CircleCreator(xfPointer_CS);
PointerScript script = PointerManager.m_Instance.MainPointer;
script.CreateNewLine(
App.Scene.ActiveCanvas,
xfPointer_CS,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using TiltBrush;
using UnityEditor;
using UnityEngine;
using Valve.Newtonsoft.Json.Utilities;
using Object = UnityEngine.Object;
using UnityEngine;
using UnityEngine.Events;
//
//Custom grabbable script wich checks if the grabber "is mine" to actually grab
//
namespace Networking.Pun2
{
[RequireComponent(typeof(Photon.Pun.PhotonView))]