Skip to content

Instantly share code, notes, and snippets.

@Janooba
Janooba / Extensions.cs
Last active February 5, 2024 02:23
Extensions needed for CSGAutoColliderAddBuildProcessor.cs
public static class UnityExtensions
{
public static Transform FindDeepChild(this Transform aParent, string aName)
{
Queue<Transform> queue = new Queue<Transform>();
queue.Enqueue(aParent);
while (queue.Count > 0)
{
var c = queue.Dequeue();
if (c.name == aName) return c;
using InternalRealtimeCSG;
using RealtimeCSG.Components;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
/// <summary>
/// Created: 03-19-2019
/// Updated:
@Janooba
Janooba / GraphCustom.shader
Created March 13, 2019 02:58
Custom graph shader that allows the input of a line thickness value
Shader "Graphy/Graph Custom"
{
Properties
{
[PerRendererData] _MainTex("Sprite Texture", 2D) = "white" {}
_Color("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap("Pixel snap", Float) = 0
_LineThickness("Line Thickness", Int) = 1
_GoodColor("Good Color", Color) = (1,1,1,1)
@Janooba
Janooba / G_AbstractedGraph.cs
Created March 13, 2019 02:49
The abstracted grapher for graphy
/* ---------------------------------------
* Author: Martin Pane (martintayx@gmail.com) (@tayx94)
* Collaborators: Lars Aalbertsen (@Rockylars)
* Project: Graphy - Ultimate Stats Monitor
* Date: 15-Dec-17
* Studio: Tayx
*
* This project is released under the MIT license.
* Attribution is not required, but it is always welcomed!
* -------------------------------------*/
for (int u = 0; u < blocks.Length; u++)
for (int v = 0; v < blocks[u].Span.Length; v++)
{
Block block = blocks[u];
Span span = blocks[u].Span[v];
// If there is a style, it has a list style, and it's list type isn't "None"
if (span.Text.Trim().Length > 0 &&
block.Style != null &&
block.Style.ListStyle != null &&
block.Style.ListStyle.ListType != "None")
@Janooba
Janooba / SpriteActivity.java
Created April 8, 2016 21:17
The basics needed to use Sprite.java or ScrollingImage.java
public class SpriteSheetActivity extends Activity
{
// Our object that will hold the view and
// the sprite sheet animation logic
GameView gameView;
@Override
public void onCreate(Bundle savedInstanceState)
{