Skip to content

Instantly share code, notes, and snippets.

View celechii's full-sized avatar
🥰
videos game

Noé Charron celechii

🥰
videos game
View GitHub Profile
@celechii
celechii / PronounSystem.cs
Last active January 18, 2024 06:22
Pronoun System to be used for keeping track of character's pronouns and determining when and how to use them :)
/*
MIT License
Copyright (c) 2021 Noé Charron
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
@celechii
celechii / ScreenshotTool.cs
Last active December 3, 2020 23:30
a little screenshot tool! takes a screenshot n saves it as a png onto ur desktop :)
using System;
using System.Collections;
using UnityEngine;
public class ScreenshotTool : MonoBehaviour {
private static ScreenshotTool control;
private void Awake() {
control = this;
public struct MultiBool {
private int count;
private bool hasMin;
private bool hasMax;
private int max;
private int min;
public static MultiBool WithMin(int min) {
MultiBool b = new MultiBool();
using UnityEngine;
public class DirectionMaze : MonoBehaviour {
[System.Flags]
public enum Direction {
Up = 1 << 0,
Down = 1 << 1,
Left = 1 << 2,
Right = 1 << 3
using UnityEngine;
public class Maze : MonoBehaviour {
public Vector2Int mazeSize = new Vector2Int(15, 15); // this should b odd dimensions
[SerializeField]
public bool drawGizmos = true;
private bool[, ] maze;
private Vector2Int prevSize; // delete this, the OnValidate() method, n the OnDrawGizmos() method if u dont wanna preview it in the editor
@celechii
celechii / ColourSmoothDamp.cs
Last active October 4, 2020 18:00
a smoothdamp function for unity colours. not optimized or rlly thought thru, i just replaced a bunch of shit
// based on how ive been told unity did it:
// https://stackoverflow.com/questions/61372498/how-does-mathf-smoothdamp-work-what-is-it-algorithm
public static Color ColourSmoothDamp(Color current, Color target, ref Vector4 currentVelocity, float smoothTime) =>
ColourSmoothDamp(current, target, ref currentVelocity, smoothTime, Mathf.Infinity, Time.deltaTime);
public static Color ColourSmoothDamp(Color current, Color target, ref Vector4 currentVelocity, float smoothTime, float maxSpeed) =>
ColourSmoothDamp(current, target, ref currentVelocity, smoothTime, maxSpeed, Time.deltaTime);
public static Color ColourSmoothDamp(Color current, Color target, ref Vector4 currentVelocity, float smoothTime, float maxSpeed, float deltaTime) {
// Based on Game Programming Gems 4 Chapter 1.10