Skip to content

Instantly share code, notes, and snippets.

View gabrieldevsouza's full-sized avatar
👾
Hello World!

Gabriel de Souza gabrieldevsouza

👾
Hello World!
View GitHub Profile
@gabrieldevsouza
gabrieldevsouza / InfiniteGrid.shader
Created October 12, 2023 14:29 — forked from bgolus/InfiniteGrid.shader
Infinite Grid shader with procedural grid with configurable divisions and major and minor lines markings.
Shader "Unlit/InfiniteGrid"
{
Properties
{
[Toggle] _WorldUV ("Use World Space UV", Float) = 1.0
_GridScale ("Grid Scale", Float) = 1.0
_GridBias ("Grid Bias", Float) = 0.5
_GridDiv ("Grid Divisions", Float) = 10.0
_BaseColor ("Base Color", Color) = (0,0,0,1)
_LineColor ("Line Color", Color) = (1,1,1,1)
Shader "Custom/yar" {
Properties {
_ColorLow ("Color Low", COLOR) = (1,1,1,1)
_ColorHigh ("Color High", COLOR) = (1,1,1,1)
_yPosLow ("Y Pos Low", Float) = 0
_yPosHigh ("Y Pos High", Float) = 10
_GradientStrength ("Graident Strength", Float) = 1
_EmissiveStrengh ("Emissive Strengh ", Float) = 1
_ColorX ("Color X", COLOR) = (1,1,1,1)
_ColorY ("Color Y", COLOR) = (1,1,1,1)
using UnityEngine;
public static class Collider2DExtension
{
/// <summary>
/// Return the closest point on a Collider2D relative to point
/// </summary>
public static Vector2 ClosestPoint(this Collider2D col, Vector2 point)
{
GameObject go = new GameObject("tempCollider");
@gabrieldevsouza
gabrieldevsouza / GravityItem.cs
Created June 22, 2018 21:52 — forked from phosphoer/GravityItem.cs
Mario Galaxy Gravity for Unity
// The MIT License (MIT)
// Copyright (c) 2016 David Evans @phosphoer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
@gabrieldevsouza
gabrieldevsouza / SomaMaxima.cpp
Created November 4, 2017 01:37
SomaMaxima created by GabrielDeSouza - https://repl.it/NjVe/0
Empty file
@gabrieldevsouza
gabrieldevsouza / Binary Tree.cpp
Created October 4, 2017 20:43
Binary Tree created by GabrielDeSouza - https://repl.it/MG7H/42
#include <iostream>
using namespace std;
struct node{
int data;
struct node *left, *right;
};
typedef struct node * noPtr;
@gabrieldevsouza
gabrieldevsouza / LaserScript.cs
Created May 21, 2016 10:51
A simple expendable Laser script for Unity
using UnityEngine;
using System.Collections;
public class LaserScript : MonoBehaviour
{
[Header("Laser pieces")]
public GameObject laserStart;
public GameObject laserMiddle;
public GameObject laserEnd;