Skip to content

Instantly share code, notes, and snippets.

View xavierarpa's full-sized avatar
😎
Breaking Rules

Xavier Arpa xavierarpa

😎
Breaking Rules
View GitHub Profile
Shader "Pristine Triplanar Grid"
{
Properties
{
[KeywordEnum(World,Object,ObjectAlignedWorld)] _GridSpace ("Grid Space", Float) = 0.0
_GridScale ("Grid Scale", Float) = 1.0
[Toggle(USE_VERTEX_NORMALS)] _UseVertexNormals ("Use Vertex Normals", Float) = 0.0
[Toggle] _ShowOnlyTwo ("Show Only Two Grid Axis", Float) = 0.0
Shader "Pristine Grid"
{
Properties
{
[KeywordEnum(MeshUV, WorldX, WorldY, WorldZ)] _UVMode ("UV Mode", Float) = 2.0
_GridScale ("Grid Scale", Float) = 1.0
_LineWidthX ("Line Width X", Range(0,1.0)) = 0.01
_LineWidthY ("Line Width Y", Range(0,1.0)) = 0.01
Shader "Hidden/JumpFloodOutline"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "PreviewType" = "Plane" }
Cull Off ZWrite Off ZTest Always
@xavierarpa
xavierarpa / IntExtensions.cs
Created January 12, 2024 14:51
IntExtensions.cs
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
public static class IntExtensions
{
public static TaskAwaiter GetAwaiter(this int number)
{
return Task.Delay(number * 1000).GetAwaiter();
}
}
@xavierarpa
xavierarpa / AsyncExtensorUtils.cs
Created October 20, 2023 08:34
change Task to Coroutine and to Task
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Threading.Tasks;
public static class AsyncExtensorUtils
{
public static IEnumerator ToCoroutine(this Task _task)
{
while (!_task.IsCompleted) yield return null;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Threading.Tasks;
public static class AsyncExtensorUtils
{
public static IEnumerator ToCoroutine(this Task _task)
{
while (!_task.IsCompleted) yield return null;
// c# companion script
// SpriteUVToShader.cs -------------------------------------------------------------------------------------------------------------------------------- //
// Save you your project, add to your SpriteRenderer gameObject
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[ExecuteInEditMode]
Shader "Custom/UI Gradient" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_GradientDirection ("Gradient Direction", Range(0, 360)) = 0
_Color1 ("Color 1", Color) = (1,1,1,1)
_Color2 ("Color 2", Color) = (0,0,0,1)
}
SubShader {
Tags { "Queue"="Transparent" "RenderType"="Transparent" }
Shader "Custom/GradientWave2" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_ColorStart ("Start Color", Color) = (1, 1, 1, 1)
_ColorEnd ("End Color", Color) = (0, 0, 0, 1)
_Speed ("Speed", Range(0, 10)) = 1
_WaveSpeedH ("Wave Speed Horizontal", Range(-10, 10)) = 0.5
_WaveSpeedV ("Wave Speed Vertical", Range(-10, 10)) = 0.5
_WaveAmountH ("Wave Amount Horizontal", Range(0, 1)) = 0.1
_WaveAmountV ("Wave Amount Vertical", Range(0, 1)) = 0.1
@xavierarpa
xavierarpa / unity-generate-uml.yml
Last active September 13, 2023 02:34
C# to UML Diagram
name: Generate UML
on:
push:
branches:
- master
workflow_dispatch:
jobs:
generate-uml:
name: 'Generate UML'