Skip to content

Instantly share code, notes, and snippets.

View instance-id's full-sized avatar

instance.id instance-id

View GitHub Profile
@instance-id
instance-id / unityfixlayout.ps1
Last active November 23, 2020 03:11
Unity: "Failed to load layout window" fix. See new version : https://gist.github.com/instance-id/3161cc2b5343db5bc3cef494d83a7449
#--------------------------------------------------------------------------------------------------------------
# This has been updated and changed to include several new features. See the link below for updated version: --
# https://gist.github.com/instance-id/3161cc2b5343db5bc3cef494d83a7449 ----------------------------------------
#--------------------------------------------------------------------------------------------------------------
# Replace folder paths in $projectLocations array (line 20) with your actual Unity project folder path(s)
# Usage: .\unityfixlayout.ps1 -Project MyProjectName
Param (
[Parameter()]
@instance-id
instance-id / Unity_backup_project_list.ps1
Last active November 3, 2020 00:20
Unity project backup via RClone using Powershell ()
# Put the Unity projects you want to back up in this list, then this is the file that you run to perform the backups.
# This script calls the main script and passes in the below data for each project you want to backup.
&C:\Users\***YOUR_USER_NAME***\.backup\_projects\projects_backup.ps1 -Project My_killer_game -Source E:\_unity\_projects\My_killer_game
&C:\Users\***YOUR_USER_NAME***\.backup\_projects\projects_backup.ps1 -Project My_other_killer_game -Source E:\_unity\_projects\My_other_killer_game
# ^-- Change to your username and location of ^-- Name of Project ^ Project source file location
# project_backup.ps1 and Unity.fltr file
using System;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
namespace MultiplayerARPG
{
public class ClassList : EditorWindow
{
@instance-id
instance-id / VehicleMovementSystem.cs
Last active November 5, 2020 19:50
Switching from setting position to applying velocity.
using Unity.Burst;
using Unity.Collections;
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Physics;
using Unity.Physics.Extensions;
using Unity.Physics.Systems;
using Unity.Transforms;
using UnityEngine;
@instance-id
instance-id / LoadingHandler.cs
Last active August 6, 2020 23:13
In process of learning Addressables, this file is not to be taken seriously. Mostly just tests.
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using instance.id.ECS.Editor;
using Sirenix.OdinInspector;
using Unity.Entities;
using UnityEditor;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
@instance-id
instance-id / CreateAddressableWithShortName.cs
Last active January 23, 2024 15:32
An example of creating an Addressable GameObject from a prefab with a simplified name
// ------------------------------------------------------------------------------------ AddressInfo
// --- AddressInfo --------------------------------------------------------------------------------
public static class AddressInfo
{
public static string prefabGroup = "Prefabs";
public static string prefabLabel = "Prefab";
}
// ------------------------------------------------------------------------------ AddressableHelper
// --- AddressableHelper --------------------------------------------------------------------------
@instance-id
instance-id / TestCode.cs
Last active July 29, 2020 06:19
Results of comparison tests
[Button("Run Performance Test")]
public void PerformanceGauge()
{
for (int t = 0; t < 10; t++)
{
// ------------------------------------------------------------------------------ Test1
// -- Waypoint Test1 Comparison using '==' --------------------------------------------
var test1Tagged = new Dictionary<GameObject, bool>();
var test1Count = 0;
var test1Stopwatch = new Stopwatch();
@instance-id
instance-id / build.ps1
Created June 30, 2020 12:14
Hugo deploy/build script from secondary branch to master. Build script converts data templte to json to be used via api.
$param1 = $args[0]
write-host $param1
Write-Host "Begin building site files $param1..."
$sourceDirectory = "E:/GitHub/instance-id.github.io/project_builder"
# Build the project
& Set-Location $sourceDirectory
if($param1 -eq "settings"){
& node toml.js replace -c .\searcher-settings.json
@instance-id
instance-id / build.ps1
Last active June 30, 2020 12:18
Houdini addon: package to zip
# .\build.ps1 -Zip -Version v0.1.0
Param (
[Parameter()]
[string]$Version,
[switch]$Zip
)
if ($Version) {
Write-Host "Building $Version..."
} else {
@instance-id
instance-id / Searcher.json.md
Last active June 25, 2020 05:15
Searcher package config example

Searcher.json

// ------------------------------ Searcher --------------------------------------
// --- Make sure this file resides in your Houdini settings/packages           --
// --- folder as listed below:                                                 --
// --- Windows: C:\Users\<user>\Documents\houdini18.0\packages                 --
// --- Linux:   /home/<user>/houdini18.0/packages                              --
// --- MacOS:   /Users/<user>/Library/Preferences/houdini/18.0/packages        --
// ----------------------------- instance.id ------------------------------------