Skip to content

Instantly share code, notes, and snippets.

View Amitkapadi's full-sized avatar

Amit Kapadi Amitkapadi

View GitHub Profile
@Amitkapadi
Amitkapadi / README.md
Created April 18, 2024 10:44 — forked from j-mai/README.md
A guide for using Unity and Git

Using Git with Unity

What are the problems?

  • Noise: Unity editor has lots of temporary files that we don’t want git to track
  • Broken object references: Unity keeps track of objects created by using random GUIDs, and if they aren’t tracked using .meta files then there can be conflicts that really break your project
  • Unresolvable merge conflicts: files like scene files that are written in confusing languages (like YAML) that are supposed to be translations of Unity editor actions into code. Most likely, you cannot resolve using Git, and the only way to resolve merge conflicts is to open it in a text editor and resolve them manually while hoping you don't mess anything up because these files are confusing and not meant to be manipulated directly.
  • Large files: Sometimes assets are large and take up a lot of storage space

💻 Project Setup

@Amitkapadi
Amitkapadi / MultiSplineFollower.cs
Created February 26, 2024 10:32
[MultiSplineFollower] #unity #spline #DreamteckSplines
using System.Collections;
using System.Collections.Generic;
using Dreamteck.Splines;
using Dreamteck.Splines.Primitives;
using UnityEngine;
public class MultiSplineFollower : MonoBehaviour
{
[System.Serializable]
public class SplineData
@Amitkapadi
Amitkapadi / submit.md
Created December 20, 2023 10:07 — forked from tanaikech/submit.md
Transferring Owner of File to Other User using Google Apps Script

Transferring Owner of File to Other User using Google Apps Script

This is a sample script for transferring the ownership of a file to another user using Google Apps Script.

In the current stage, about the consumer account (gmail.com) the specification for transferring the ownership of a file has been changed as follows. Ref

  1. The current owner initiates an ownership transfer by creating or updating the prospective new owner's file permission. The permission must include these settings: role=writer, type=user, and pendingOwner=true. If the new owner is creating a permission for the prospective owner, an email notification is sent to the prospective new owner indicating that they're being asked to assume ownership of the file.
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;
/// <summary>
/// Gist importer.
@Amitkapadi
Amitkapadi / Emoji.cs
Created June 28, 2023 07:12 — forked from seekeroftheball/Emoji.cs
Lightweight static emoji library for the Unity Game Engine. Returns strings usable in the editor and in games.
//Author : https://github.com/seekeroftheball https://gist.github.com/seekeroftheball
//Version : 1.1
//Updated : March 2023
using System.Collections.Generic;
namespace Seeker.Emojis
{
/// <summary>
/// Lightweight static emoji library.
/// <para/>Note: Not all emojis will function in all parts of the Unity editor.
@Amitkapadi
Amitkapadi / easing.js
Created May 4, 2023 11:11 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@Amitkapadi
Amitkapadi / WavyImage.cs
Created April 24, 2023 12:11 — forked from yasirkula/WavyImage.cs
Create UI image with wave animation in Unity
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Sprites;
using UnityEngine.UI;
#if UNITY_2017_4 || UNITY_2018_2_OR_NEWER
using UnityEngine.U2D;
#endif
#if UNITY_EDITOR
using UnityEditor;
@Amitkapadi
Amitkapadi / android-backup-apk-and-datas.md
Created March 20, 2023 12:01 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

Fetch application APK

@Amitkapadi
Amitkapadi / CurveLerpControl.cs
Created March 2, 2023 04:59
[CurveLerpControl] #camera # lerp #animation
using UnityEngine;
public class CurveLerpControl
{
public Transform target;
public Vector3 focusPoint;
public Vector3 pos1, pos2;
public Quaternion angle1, angl2;
float d1, d2;
@Amitkapadi
Amitkapadi / LayoutUtility.cs
Created January 31, 2023 07:04
LayoutUtility for Unity World Space.
namespace MyUtility
{
public static class LayoutUtility
{
public static float[] GetXPosLayout(int totalObj, float maxWidth, float objXSize, float space, float xPedding)
{
float maxSize = maxWidth - xPedding - xPedding; //Left and Right
float occupiedArea = (totalObj * objXSize);
float halfObjSize = objXSize * 0.5f;