Skip to content

Instantly share code, notes, and snippets.

View xavierarpa's full-sized avatar
👁️
I shut my eyes in order to see

Xavier Arpa xavierarpa

👁️
I shut my eyes in order to see
View GitHub Profile
@xavierarpa
xavierarpa / UNITY_MCP_SETUP.md
Created March 19, 2026 13:07
MCP para Unity — Guía de Instalación y Configuración

MCP para Unity — Guía de Instalación y Configuración

Guía paso a paso para conectar un agente IA (GitHub Copilot en VS Code) con el Unity Editor a través de MCP (Model Context Protocol). Esto permite que la IA cree GameObjects, modifique escenas, lea logs de consola, ejecute tests y más — todo desde VS Code.

Requisitos Previos

Requisito Versión mínima Verificar con
Unity 2021.3 LTS+ Hub de Unity
Python 3.10+ python --version
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