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 / 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 February 10, 2024 01:38
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 April 29, 2023 17:18
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 3, 2023 17:11
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