Skip to content

Instantly share code, notes, and snippets.

View tatelax's full-sized avatar

Tate McCormick tatelax

View GitHub Profile
// check for 'real' null
if (ReferenceEquals(obj, null)) {
}
// check for 'real' not-null
if (ReferenceEquals(obj, null) == false) {
}
// check for 'unity' null
if (obj == false) {
@tatelax
tatelax / BuildCLI.cs
Created October 13, 2021 02:11
Build CLI
namespace Scripts.Utils.BuildMaker.Editor
{
public static class BuildCLI
{
// Called via editor in batchmode command line arguments
public static void Build()
{
string[] args = System.Environment.GetCommandLineArgs();
string buildProfile = null;
@tatelax
tatelax / example.jenkinsfile
Created October 12, 2021 16:20
A basic Jenkinsfile for Unity projects
pipeline {
agent {
node {
label 'windows'
}
}
environment {
VERSION = readFile(file: "game/Assets/StreamingAssets/version.txt").trim()
}
stages {
@tatelax
tatelax / Option.cs
Last active September 22, 2021 17:43
fholm's Option<T>
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
public struct Option<T> : IEquatable<Option<T>> {
T _value;
bool _hasValue;
public T Value {
[MethodImpl(MethodImplOptions.AggressiveInlining)]