Skip to content

Instantly share code, notes, and snippets.

View sathyarajshetigar's full-sized avatar

Sathyaraj Shettigar sathyarajshetigar

  • Ironjaw Studios Pvt. Ltd
View GitHub Profile
@fadookie
fadookie / CameraAnchor.cs
Last active April 29, 2024 12:19
Screen-relative anchoring component for Unity3D. Find more Unity code at http://www.eliotlash.com/2015/01/unity3d-components-and-code-snippets/
/***
* This script will anchor a GameObject to a relative screen position.
* This script is intended to be used with ViewportHandler.cs by Marcel Căşvan, available here: http://gamedev.stackexchange.com/a/89973/50623
* It is also copied in this gist below.
*
* Note: For performance reasons it's currently assumed that the game resolution will not change after the game starts.
* You could not make this assumption by periodically calling UpdateAnchor() in the Update() function or a coroutine, but is left as an exercise to the reader.
*/
/* The MIT License (MIT)
@ArturoNereu
ArturoNereu / UI-Fast-Default
Created April 8, 2016 18:12
A simpler version of the UI Shader for mobile and low spec devices
Shader "UI/Fast-Default"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
}
SubShader
{
@douduck08
douduck08 / README.md
Last active May 16, 2024 18:25
The general GetValue extension of SerializedProperty in Unity Editor.

Unity's SerializedProperty not support custom type value setting. This extension use Reflection to get target instance of SerializedProperty in Custom Editor, made value setting of general type is posible.

@yasirkula
yasirkula / CircleGraphic.cs
Last active July 10, 2024 08:55
Create circles/ellipses in Unity UI system in one of three modes: FillInside, FillOutside and Edge.
using UnityEngine;
using UnityEngine.UI;
#if UNITY_EDITOR
using UnityEditor;
// Custom Editor to order the variables in the Inspector similar to Image component
[CustomEditor( typeof( CircleGraphic ) ), CanEditMultipleObjects]
public class CircleGraphicEditor : Editor
{
@charlieamat
charlieamat / Bootstrap.cs
Last active March 29, 2023 08:52
A custom Log4Net Appender that outputs log statements to the Unity console.
using System.IO;
using log4net.Config;
using UnityEngine;
public static class Bootstrap
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void ConfigureLogging()
{
XmlConfigurator.Configure(new FileInfo($"{Application.dataPath}/log4net.xml"));
# install_certifi.py
#
# sample script to install or update a set of default Root Certificates
# for the ssl module. Uses the certificates provided by the certifi package:
# https://pypi.python.org/pypi/certifi
import os
import os.path
import ssl
import stat
@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active July 9, 2024 18:56
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@yasirkula
yasirkula / SlicedFilledImage.cs
Last active July 16, 2024 16:18
Combining UI Image's Sliced+Filled features together in Unity
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
#if UNITY_2017_4 || UNITY_2018_2_OR_NEWER
using UnityEngine.U2D;
#endif
using Sprites = UnityEngine.Sprites;
#if UNITY_EDITOR
@Z4urce
Z4urce / ScrollToSelectionBehaviour.cs
Last active May 9, 2021 18:23
Moves the Content transform so the current selected object will be inside the Viewport rect
// Source: https://gist.github.com/Z4urce/e1719b3c1641537ced54da24d911f0b0
// Moves the Content transform so the current selected object will be inside the Viewport rect
using UnityEngine;
using UnityEngine.EventSystems;
namespace Utils
{
public sealed class ScrollToSelectionBehaviour : MonoBehaviour
{