Skip to content

Instantly share code, notes, and snippets.

View RuchirRaj's full-sized avatar
:electron:

Ruchir Raj RuchirRaj

:electron:
  • BITS Pilani, Hyderadbad
  • India
View GitHub Profile
@RuchirRaj
RuchirRaj / GradientTexGen
Created July 3, 2024 14:02 — forked from mattatz/GradientTexGen
Gradient Texture2D Generator for Unity.
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
using System.IO;
using System.Collections;
namespace mattatz.Utils {
@RuchirRaj
RuchirRaj / JsonPlayerPrefs.cs
Created June 28, 2023 20:30 — forked from kurtdekker/JsonPlayerPrefs.cs
A replacement for Unity's PlayerPrefs that stores data in a JSON file.
using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
/// <summary>
/// A replacement for Unity's PlayerPrefs that stores data in a JSON file.
/// </summary>
[Serializable]
public class JsonPlayerPrefs
@RuchirRaj
RuchirRaj / EventManager.cs
Created February 12, 2022 06:47 — forked from bendangelo/EventManager.cs
Unity3D C# Event Manager
/*
* Copyright 2017 Ben D'Angelo
*
* MIT License
*
* 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:
@RuchirRaj
RuchirRaj / UniversalPipelineTemplateShader.shader
Created October 4, 2021 12:18 — forked from phi-lira/UniversalPipelineTemplateShader.shader
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
@RuchirRaj
RuchirRaj / MaterialGradientDrawer.cs
Created August 22, 2021 20:13 — forked from totallyRonja/MaterialGradientDrawer.cs
A Material Property Drawer for the [Gradient] attribute which lets you edit gradients and adds them to the shader as textures. More information here: https://twitter.com/totallyRonja/status/1368704187580682240
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;
public class MaterialGradientDrawer : MaterialPropertyDrawer {
private int resolution;
@RuchirRaj
RuchirRaj / PronounSystem.cs
Created August 11, 2021 16:58 — forked from celechii/PronounSystem.cs
Pronoun System to be used for keeping track of character's pronouns and determining when and how to use them :)
using UnityEngine;
[System.Serializable]
public class PronounSystem {
public static PronounData[] customPronouns = new PronounData[3];
private static PronounData theyThem = new PronounData("they/them/their/theirs/themself", true);
private static PronounData sheHer = new PronounData("she/her/her/hers/herself", false);
private static PronounData heHim = new PronounData("he/him/his/his/himself", false);
private static PronounData zeZir = new PronounData("ze/zir/zir/zirs/zirself", false);
private static PronounData zeHir = new PronounData("ze/hir/hir/hirs/hirself", false);
@RuchirRaj
RuchirRaj / SpriteAtlasAsset.cs
Created August 11, 2021 16:56 — forked from phosphoer/SpriteAtlasAsset.cs
Unity Sprite Atlas Asset
// The MIT License (MIT)
// Copyright (c) 2021 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 IN
@RuchirRaj
RuchirRaj / LICENSE
Created August 10, 2021 19:13 — forked from JohannesMP/LICENSE
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*