Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

Tomas Varaneckas spajus

🌴
On vacation
View GitHub Profile
View LoadPrefab.cs
using UnityEngine;
namespace KL.Utils {
public class LoadPrefab : MonoBehaviour {
#pragma warning disable 0649
[SerializeField] private GameObject prefab;
[SerializeField] private bool inEditor = true;
[SerializeField] private bool inRuntime = true;
#pragma warning restore 0649
@spajus
spajus / CompileTime.cs
Created Jul 2, 2020
Put this into Scripts/Editor and open via Unity menu Kodo Linija > Compile Time
View CompileTime.cs
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Compilation;
using UnityEditor.SceneManagement;
using UnityEngine;
class CompileTime : EditorWindow {
bool allowProfiler = false;
bool isTrackingTime;
@spajus
spajus / FPSHandbrake.cs
Last active May 14, 2020
Unity MonoBehaviour that stops the editor play mode before it's too late
View FPSHandbrake.cs
using UnityEngine;
using UnityEngine.Profiling;
namespace KL.Utils {
public class FPSHandbrake : MonoBehaviour {
private float stopEditorAtFPS = 5;
private float memoryMaxMB = 1024 * 10;
private float stopEditorDelay = 10;
private float stopFrameDurationTreshold = 1;
@spajus
spajus / Missing.txt
Created May 4, 2020
BRS extra translations for v1.5.0
View Missing.txt
# New translations since v1.5.0
term.none,None
btn.extra,Extra
race.modifiers,Race Modifiers
race.select_challenge,Select Challenge
race.challenges,Challenges
race.challenge_target,Challenge Target
race.challenge_target.players,Players Only
race.challenge_target.everyone,Everyone
mission.type.none,None
@spajus
spajus / GameObjectMetadata.cs
Last active Apr 30, 2020
A component that tracks other Unity GameObject components, and reports when and what exactly is missing
View GameObjectMetadata.cs
using UnityEngine;
namespace KL.Utils.Behaviours {
[DefaultExecutionOrder(int.MinValue)]
[ExecuteInEditMode]
public class GameObjectMetadata : MonoBehaviour {
[SerializeField] private string[] components;
private void Start() {
@spajus
spajus / Description.txt
Last active Apr 23, 2020
Bloody Rally Show store page texts
View Description.txt
Bloody Rally Show is dystopian roguelite combat racing game with infinite variety of race tracks, campaigns, missions, leaderboards, daily challenges, track editor, car editor, car tuning, customization, car battles, and multiple game modes, including one where you are a pedestrian.
View Layers To Sprite Sheet.js
// Put this file in Program Files\Adobe\Photoshop\Presets\Scripts\
// In PhotoShop menu File > Scripts > Layers To Sprite Sheet
// Arrange layers into a sprite sheet.
if (documents.length > 0) {
var docRef = activeDocument;
var numLayers = docRef.artLayers.length;
var cols = docRef.width;
View spajus.pub
ssh-dss AAAAB3NzaC1kc3MAAACBAIJ+UCYFJ1mKfFqORYzMYmid9DxBF3JMh8+1/qw06Y/Npi3Tjh11PDu2KXJeJ8TP3m/ZC0Tk8WgKpOE5ypMof+jq8KEmdan1qnln+b0pj4yOhNAn6QPx1PeON/ExaQWT4A5zuGUY0ozDPu6MiQ/P0AwYTXzo2obgO/2KeuO08JT3AAAAFQCLISGoMcdeXjfGHgNZRtsC+JAvkQAAAIBkDNadD8MepoLIHcK5/RfbdK8bKLb5z+WJYi6UNmevVLFK4BOq81qWqzN4k2Boe+XK6ZS8CadAHEypC52Nmp+6FXGcMGPJNONUdrzW0EfC5957ee93W5/qmScrBom0CTOtIK0Jz+0oO5h9dNkLI31hhaKc36Y/yQjdnh8epq4VyAAAAIAC0kIG8yLyc9lX21KXdh0myRcvtJhMiRRxnDbfwDkyciwicBMLpti5D8oXQ2OPOtQU3J+aNkL7efkZbkZqahtIhxbB31aTQhbF0YQO5ol6t+tIxWAgU36N5eQbN1GgHMpg/3ZX93rfreL0HBnQypwcUAHY6rxqzpxPzkUmUBib/A== tomasv
View tomasv.pub
ssh-dss AAAAB3NzaC1kc3MAAACBAIJ+UCYFJ1mKfFqORYzMYmid9DxBF3JMh8+1/qw06Y/Npi3Tjh11PDu2KXJeJ8TP3m/ZC0Tk8WgKpOE5ypMof+jq8KEmdan1qnln+b0pj4yOhNAn6QPx1PeON/ExaQWT4A5zuGUY0ozDPu6MiQ/P0AwYTXzo2obgO/2KeuO08JT3AAAAFQCLISGoMcdeXjfGHgNZRtsC+JAvkQAAAIBkDNadD8MepoLIHcK5/RfbdK8bKLb5z+WJYi6UNmevVLFK4BOq81qWqzN4k2Boe+XK6ZS8CadAHEypC52Nmp+6FXGcMGPJNONUdrzW0EfC5957ee93W5/qmScrBom0CTOtIK0Jz+0oO5h9dNkLI31hhaKc36Y/yQjdnh8epq4VyAAAAIAC0kIG8yLyc9lX21KXdh0myRcvtJhMiRRxnDbfwDkyciwicBMLpti5D8oXQ2OPOtQU3J+aNkL7efkZbkZqahtIhxbB31aTQhbF0YQO5ol6t+tIxWAgU36N5eQbN1GgHMpg/3ZX93rfreL0HBnQypwcUAHY6rxqzpxPzkUmUBib/A== tomasv
@spajus
spajus / rake.txt
Created Aug 17, 2014
gosu ruby app
View rake.txt
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/spajus/.rvm/rubies/ruby-2.1.2/lib/libruby.2.1.0.dylib and UniversalRuby/libruby.2.1.0.dylib have the same architectures (x86_64) and can't be in the same fat output file
rake aborted!
Command failed with status (1): [lipo /Users/spajus/.rvm/rubies/ruby-2.1.2/...]
/Users/spajus/GitHub/ruby_app/Rakefile:19:in `merge_lib'
/Users/spajus/GitHub/ruby_app/Rakefile:49:in `block in <top (required)>'
Tasks: TOP => default => merge_current_platform_into_universal_ruby