Skip to content

Instantly share code, notes, and snippets.

View gamefish's full-sized avatar

Bill Yang gamefish

View GitHub Profile
@gamefish
gamefish / CreateGitRepo.sh
Created June 4, 2022 16:27
Create git repository mac script, also create git ignore file .gitattributes, and track large files using Git LFS
#!/bin/bash
## call git init
git init
## make .gitignore
cat > .gitignore << EOF
# old school
.svn
# Mac OS X
@gamefish
gamefish / Example.cs
Last active April 18, 2022 07:38
[Sign in with Apple Unity official example] Showcase how to sign in with Apple account in unity
public SignInWithApple signInWithApple;
signInWithApple.Login((args) =>
{
if(!string.IsNullOrEmpty(args.error))
{
LogMessage("Apple -> sign in error:" + args.error);
return;
}
string idToken = args.userInfo.idToken;
@gamefish
gamefish / SaveLoadTransform.cs
Created April 1, 2022 13:21
Save and load transform data, used to restore object transform
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SaveLoadTransform : MonoBehaviour
{
Vector3 savedLocalPosition;
Quaternion savedLocalRotation;
Vector3 savedLocalScale;
Transform savedParent;
@gamefish
gamefish / ScriptFileWatcher.cs
Last active July 5, 2023 01:16
[Auto compile scripts at background] Let Unity editor auto compile scripts in background if any of scripts has been modified #unity #editor #compile #building
#if UNITY_EDITOR
using System.IO;
using System.Threading;
using UnityEditor;
/// <summary>
/// use fswatch to monitor Scripts folder,start auto compile in background before Unity gets focused
/// for Mac users, use: 'brew install fswatch' to install fswatch
/// </summary>
@gamefish
gamefish / AutoFillAndroidSignPassword.cs
Created April 1, 2022 08:29
[Auto fill android signing password in unity editor] #unity #editor #signing
using UnityEngine;
using UnityEditor;
using System.IO;
[InitializeOnLoad]
public class AutoFillAndroidSignPassword
{
static AutoFillAndroidSignPassword ()
{