Skip to content

Instantly share code, notes, and snippets.

View Vixxd's full-sized avatar
🏠
Working from home

Vicky Vixxd

🏠
Working from home
View GitHub Profile
@stonstad
stonstad / UnityUtils.cs
Created September 22, 2020 17:15
Locate Unity Assets Which Contain Broken References
using System;
using System.IO;
using UnityEditor;
using UnityEngine;
using System.Linq;
using System.Threading.Tasks;
public class UnityUtils: MonoBehaviour
{
[MenuItem("Tools/Find Broken GUIDs")]
@tdbe
tdbe / BakeryLightmapManager.cs
Last active August 27, 2022 19:00
A lightmap manager for the Bakery lightmapper from the unity asset store. You can now swap between multiple versions of your lightmaps, and combine different bakes from different lightmap groups.
/// <summary>
/// Author: tudor, https://github.com/tdbe
/// You found this gist at: https://gist.github.com/tdbe/e3c41e6a2dedd88dad907218126a2c39
///
/// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
@LotteMakesStuff
LotteMakesStuff / 1.md
Last active January 5, 2023 20:54
UPM: How to make a custom package

UPM: How to make a custom package So, Unity has this shiny new package manager, and you have code you want to share between projects - wouldn't it be great if we could bundle up our shared code and plug it into all the projects that need it? Let's figure out how to make our own Package!


Todo

  • Modify the project manifest
  • Make a package manifest
  • Package the manifest up with some test code
  • Try it out in Unity!

using UnityEngine;
using Facepunch.Steamworks;
using UnityEngine.UI;
//
// To change at runtime set SteamId then call Fetch()
//
public class SteamAvatar : MonoBehaviour
{
public ulong SteamId;
@bhison
bhison / ScaleGrid.cs
Last active April 24, 2023 08:26
Unity3D: Scale cell size of Grid Layout Group
// Scale your grid layougt in Unity3D
// -- Add this to a gameobject with a Grid Layout Group and you can make the cell size change with resolution, by percentage of screen width.
// -- Updates as you change resolution or width percentage in editor.
// -- Runs once on play, Fix will need to be called if resolution is changed in game.
// -- Script will need expansion if you want to use non-square cells.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
@codediodeio
codediodeio / auth.service.ts
Created May 8, 2017 16:41
Angular4 Firebase authentication service using OAuth, Anonymous, and Email/Password. Designed specifically for changes introduced in AngularFire2 4.0.0
import { Injectable } from '@angular/core';
import { AngularFireDatabaseModule, AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database';
import { AngularFireAuth } from 'angularfire2/auth';
import { Router } from "@angular/router";
import * as firebase from 'firebase';
@Injectable()
export class AuthService {
@kilj
kilj / UnityCloudBuildManifest.cs
Created April 25, 2017 19:58
Unity Build Cloud: tiny script for showing buildNumber, targetName, etc on phone screen (for example).
using System;
using UnityEngine;
[Serializable]
public class UnityCloudBuildManifest
{
public string scmCommitId;
public string scmBranch;
public string buildNumber;
public string buildStartTime;
@luke161
luke161 / DownloadHandlerFile.cs
Last active June 27, 2024 02:53
Custom DownloadHandler for UnityWebRequest to stream contents into a file. Useful for preloading AssetBundles without them automatically being uncompressed and loaded into memory.
/**
* DownloadHandlerFile.cs
* Author: Luke Holland (http://lukeholland.me/)
*/
using UnityEngine;
using UnityEngine.Networking;
using System.IO;
public class DownloadHandlerFile : DownloadHandlerScript
@MarcL
MarcL / phaser-speedup.md
Created March 10, 2017 09:19
Tips on speeding up Phaser games
@GeorgiyRyaposov
GeorgiyRyaposov / CloudBuildHelper.cs
Last active December 4, 2022 07:33
Put into 'Editor' folder and add 'CloudBuildHelper.PreExport' class name in unity cloud build to pre export setting
public class CloudBuildHelper
{
#if UNITY_CLOUD_BUILD
public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
{
var buildNumber = "unknown";
manifest.TryGetValue("buildNumber", out buildNumber);
UnityEditor.PlayerSettings.bundleVersion = string.Format("1.0.{0}", buildNumber);