Skip to content

Instantly share code, notes, and snippets.

View clayjohn's full-sized avatar

Clay John clayjohn

View GitHub Profile
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoldyMeleeToast : Enemy
{
[Header("Attack")]
[SerializeField] private float minimumDistanceToAttack;
[SerializeField] private float attackSpeed;
[SerializeField] private float attackDamage;
@clayjohn
clayjohn / texture_generator.gd
Created August 5, 2019 22:04
Uses custom viewports to generate textures before the first frame is drawn
extends Node2D
var myViewport
var myCanvas
func _ready():
## Stop main viewport from drawing when we force draw
## should loop through all other viewports as well
VisualServer.viewport_set_active(get_viewport().get_viewport_rid(), false)
# initialize Viewport, needs canvas
@clayjohn
clayjohn / cube-to-panorama.glsl
Created April 9, 2019 02:13
Convert cubemap to panorama in Godot
shader_type canvas_item;
uniform sampler2D front;
uniform sampler2D left;
uniform sampler2D right;
uniform sampler2D back;
uniform sampler2D top;
uniform sampler2D bottom;
void fragment() {