Skip to content

Instantly share code, notes, and snippets.

View javier-games's full-sized avatar

Javier García javier-games

View GitHub Profile
javier-games /
Last active February 21, 2023 14:55
Git Attributes for Unity + LFS

Git Attrinutes for Unity for LFS

Add the .gitattributes to the Git repository. In order to use unityyamlmerge also add the following text to your .git or .gitconfig file:

tool = unityyamlmerge

[mergetool "unityyamlmerge"]
javier-games /
Created December 25, 2022 03:00
Enable chatGPT as chatbot on slack.
import os
import openai
from slack_sdk import WebClient
from slackeventsapi import SlackEventAdapter
from flask import Flask
# To create a chatbot on Slack, you will need to do the following steps:
# - Go to the Slack API website and sign in to your Slack account. Click on the "Start Building" button in the top
javier-games / Debug
Created May 24, 2019 19:29
Usefull utilities for debuging on Unity.

Debug Utils

Usefull utilities for debuging.

  • The May 24th, 2019 version contains: -- Debug.Log Methods to visible only in debug mode and unity editor. -- Filter System to show only desired messages.

Add this feature to your project by just adding this files. Additionally, Option A) Move the DebuUtilsSetupEditor.cs to Assets/Editor. Or option B) Add UNITY_EDITOR directives to this file to avoid compiling errors.

javier-games / Field View
Last active February 18, 2023 05:10
Determinates if a point belongs to a drawable field view in 2D.

Field View 2D

Determinates if a Contact Point belongs to a drawed field view in a plane using just the Collider 2D.

Unity Version

javier-games / Vector Jelly
Last active February 18, 2023 05:10
Vector graphics masked shader with jelly movement.

Vertor Jelly Shader

This shader is based in the UIDefault shader from the Vector Graphics package from Unity. Has been improved to suport the Mask UI component. The Jelly movement happens in line 104 to 106.

Unity Version

javier-games / iOS Home
Last active August 4, 2019 20:29
Helps to modify the iOS home button parameters.

iOS Home Button

Helps to modify the iOS home button parameters for each new scene or canvas on awake, you may consider add just one instance per scene.

  • Hide Home Button: You can hide the home button while no touches are over the screen.

  • Use Padding: Adds a black frame to the bottom over the space of the home button with bazel at the corners to simulate the iPad Pro's bazel.

  • Attenuate Home Button: In my opinion the sexiest way to deal with iOS Home Button for a game in Unity.

javier-games / Vertical Layout Group Dynamic
Last active February 18, 2023 05:09
Dynamically modify the size of the container of a vertical layout group.

Vertical Layout Group Dynamic Content

Dynamically modifies the size of the RectTransform of a VerticalLayoutGroup in Uniy. This component has to be attached to, for example, the Content GameObject of a ScrollView. If an new item is added to the container you must call the Adjust method to resize the RectTransform.

Unity Version