Skip to content

Instantly share code, notes, and snippets.

View SorraTheOrc's full-sized avatar
💭
Doings Stuff - maybe, just maybe it will be useful.

Sorra SorraTheOrc

💭
Doings Stuff - maybe, just maybe it will be useful.
View GitHub Profile
@SorraTheOrc
SorraTheOrc / copilot-instructions.md
Last active June 11, 2025 03:03
Copilot Instructions for generic project

Specifications

  • When asked to write a specification for a feature, provide a detailed description of the feature, including its purpose, functionality, and any relevant technical details.
  • Include examples or use cases to illustrate how the feature should work in practice.
  • Ensure that the specification is clear and unambiguous, allowing developers to implement the feature without needing further clarification.
  • Use consistent terminology and formatting throughout all specifications to enhance readability.
  • If applicable, reference any existing specifications, documentation or standards that the feature should adhere to.
  • Consider edge cases and potential limitations of the feature, and document how these should be handled.
  • Avoid assumptions about the implementation details unless explicitly stated, focusing instead on the desired outcomes and behaviors of the feature.
  • If the feature involves user interaction, describe the user interface elements and their expected behavior.
@SorraTheOrc
SorraTheOrc / ModelMaterialSetterEditor.cs
Last active April 20, 2025 22:33
Apply a material to all models in a folder.
using UnityEngine;
using UnityEditor;
namespace WizardsCode.Models {
/// <summary>
/// A custom Unity Editor window that allows users to find and process 3D models in a specified folder,
/// applying a selected material to all renderers within the models.
///
/// This is useful when an asset is published in which the models do not have materials applied. For things
/// like terrain details this is problematic and since there are usually many models for details the manual
// MIT License
//
// Copyright (c) Wizards Code
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@SorraTheOrc
SorraTheOrc / CoroutineHelper.cs
Created October 7, 2024 18:46
Coroutine helper
using UnityEngine;
using System.Collections;
/// <summary>
/// A helper class to start coroutines from non-MonoBehaviour classes.
///
/// Usage:
/// To start a coroutine from a non-MonoBehaviour class, call CoroutineHelper.Instance.StartHelperCoroutine(yourCoroutine).
/// Example:
/// IEnumerator YourCoroutine()
@SorraTheOrc
SorraTheOrc / InsertRegularNotes.lua
Last active October 16, 2024 05:13
Reaper Script to insert a number of midi notes - useful for SFX generation
--[[
* ReaScript Name: Insert x MIDI notes, one every y seconds, starting at the current playhead position
* Screenshot:
* Author: Wizards Code
* Author URI: httpL//www.thewizardscode.com
* Repository:
* Repository URI:
* Licence: MIT
* REAPER: 7.0 (and likely earlier)
* Version: 0.1
@SorraTheOrc
SorraTheOrc / SquadBehaviour.cs
Last active June 12, 2022 03:24
A simple script to provide more intelligent behaviour in Universal AI. It's still very basic but it improves things alot. You set up a Squad in the inspector and then in game they will tell each other of a spotted target and approach the target one at a time, giving covering fire to one another.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniversalAI;
namespace WizardsCode.UniversalAIExtension
{
public class SquadBehaviours : MonoBehaviour
{
@SorraTheOrc
SorraTheOrc / ProximityActivationManager.cs
Last active May 20, 2025 12:02
A simple optimization trick in Unity - disable/enable objects based on proximity to the player.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Sirenix.OdinInspector;
using System.Linq;
using System;
using WizardsCode;
namespace WizardsCode.Optimization
{
@SorraTheOrc
SorraTheOrc / FlickeringLights
Last active September 18, 2024 01:01
A simple Unity script to make your lights flicker. Great for candles and torches.
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// This script is under CCO License (TL;DR do what you will with it ;-)
/// See https://creativecommons.org/share-your-work/public-domain/cc0/
///
/// This works best when you have a fire or candle particle effect on the same location as the light
///
/// Check out my You Tube channel https://youtube.com/c/WizardsCode
@SorraTheOrc
SorraTheOrc / CiDyPedestrians.cs
Last active April 4, 2025 10:00
Extension to CiDy that will allow you to create a NavMesh to guide pedestrians around the city. Any NavMesh driven character can be used. I provide some basic open source pedestrian code (see https://www.patreon.com/posts/64257587 and https://youtu.be/nzzS40XHWA8) but it's not required. If you don't use my Character controller code you will need…
/*
Extension to CiDy that will allow you to create a NavMesh to guide pedestrians around the city.
Any NavMesh driven character can be used. I provide some basic open source pedestrian code
(see https://www.patreon.com/posts/64257587 and https://youtu.be/nzzS40XHWA8) but it's not
required. If you don't use my Character controller code you will need to make a couple of
small changes to the scripts (see comments) and build your own Custom Editor base on my code
below.
Add CiDyPedestrians to a convenient object in your scene, setup a couple of parameters and
click the "Build NavMesh" button.
@SorraTheOrc
SorraTheOrc / UIBlur.shader
Created December 6, 2020 06:49 — forked from JohannesMP/UIBlur.shader
UI.Image Blur Shader with layering and masking support
Shader "Custom/UIBlur"
{
Properties
{
[Toggle(IS_BLUR_ALPHA_MASKED)] _IsAlphaMasked("Image Alpha Masks Blur", Float) = 1
[Toggle(IS_SPRITE_VISIBLE)] _IsSpriteVisible("Show Image", Float) = 1
// Internally enforced by MAX_RADIUS
_Radius("Blur Radius", Range(0, 64)) = 1