Skip to content

Instantly share code, notes, and snippets.

View rob5300's full-sized avatar
🙃
Trying out new things

Robert rob5300

🙃
Trying out new things
View GitHub Profile
@rob5300
rob5300 / pixelate_colour_dither.vfx
Created June 27, 2022 18:49
Retro Pixelation + Low Bit Colour + Dither Post Processing Effect for S&Box
View pixelate_colour_dither.vfx
HEADER
{
CompileTargets = ( IS_SM_50 && ( PC || VULKAN ) );
Description = "Retro Pixelation + Low Bit Colour + Dither Post Effect";
}
FEATURES
{
}
@rob5300
rob5300 / hologram.vfx
Last active November 2, 2022 20:30
Simple Hologram shader for S&Box
View hologram.vfx
HEADER
{
CompileTargets = ( IS_SM_50 && ( PC || VULKAN ) );
Description = "Hologram Effect";
}
FEATURES
{
#include "common/features.hlsl"
@rob5300
rob5300 / SortCosmeticFiles.py
Created August 29, 2021 12:23
Sort VMT, VTF and MDL/VVD/VTX files into seperate directories
View SortCosmeticFiles.py
import shutil
import os
import sys
here = os.path.dirname(__file__)
class SortingSet:
targetFolder = ""
matches = []
@rob5300
rob5300 / AllColoursFromVMTs.py
Created August 29, 2021 12:22
A script to extract all detault tint colours from VMTs and write out the data in json.
View AllColoursFromVMTs.py
import os
import re
import json
# A script to extract all detault tint colours from VMTs
# Outputs a json file with all values, vmtname: defaultcolour.
# Where your VMT files are stored. This is relative to the scripts path.
vmtFolder = "_SourceVMT"
@rob5300
rob5300 / bzipall.py
Created November 22, 2020 16:23
BZip each file into its own archive and save into new folder structure. Useful for Source/TF2 server files to download
View bzipall.py
# BZipAll script to quickly bzip all files in a directory.
# Made by rob5300
# FILL ME IN!!! THIS MAY NOT BE RIGHT FOR YOU!!
# Full path to your 7z.exe executable from your 7z install. Plz download or install it if you need from 7-zip.org
_7zpath = r"C:\Program Files\7-Zip\7z.exe"
#Extensions to ignore
ignore = [".py", ".sp", ".smx", ".bz2"]
@rob5300
rob5300 / InterfaceExample.cs
Created August 26, 2019 21:23
Example of using Interfaces with MonoBehaviours in Unity
View InterfaceExample.cs
using UnityEngine;
public class MyBox : MonoBehaviour, IInteractable{
//We must implement this due to the interface
public void Interact(){
Debug.Log("I was interacted with!");
Destroy(gameObject);
}
}
@rob5300
rob5300 / CanvasEditorHelper.cs
Created August 21, 2019 14:26
Applies preset layermask on scene open and restores it on scene closed. Made for use in custom ui prefab editing scenes to show the UI layer automatically.
View CanvasEditorHelper.cs
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
/// <summary>
/// Applies preset layermask on scene open and restores it on scene closed.
/// Made for use in custom ui prefab editing scenes to show the UI layer automatically.
/// </summary>
[ExecuteInEditMode]
public class CanvasEditorHelper : MonoBehaviour
@rob5300
rob5300 / GameSettings.cs
Created April 28, 2019 11:32
Example of accessing static members
View GameSettings.cs
//Game settings class
public class GameSettings
{
//Declare this as static meaning it is accessable via the class name
public static RandomClass RandomSettings = new RandomClass();
}
//Class decleration for Random.
public class RandomClass
{
@rob5300
rob5300 / DialogueTriggerTrack.cs
Created August 26, 2018 20:47
Track Asset example
View DialogueTriggerTrack.cs
using UnityEngine.Timeline;
[TrackColor(0.9716981f, 0.4145757f, 0.3529281f)]
[TrackClipType(typeof(DialogueTriggerClip))]
public class DialogueTriggerTrack : TrackAsset
{
}
@rob5300
rob5300 / DialogueTriggerClip.cs
Created August 26, 2018 20:18
Dialogue Trigger Clip example
View DialogueTriggerClip.cs
using System;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
[Serializable]
public class DialogueTriggerClip : PlayableAsset, ITimelineClipAsset
{
public DialogueTriggerBehaviour template = new DialogueTriggerBehaviour ();