Skip to content

Instantly share code, notes, and snippets.

View OctopBP's full-sized avatar
🐙
Hey, how are you?

Boris Proshin OctopBP

🐙
Hey, how are you?
View GitHub Profile
@unitycoder
unitycoder / LineDrawer.cs
Created November 5, 2021 20:09
Drawing a line with Unity UI Toolkit
// Drawing a line with UITK https://forum.unity.com/threads/drawing-a-line-with-uitk.1193470/
public class LineDrawer : VisualElement
{
private Vector3 startPos, endPos;
private float thickness;
public LineDrawer(Vector3 pos1, Vector3 pos2, float width)
{
startPos = pos1;
endPos = pos2;
@FNGgames
FNGgames / TimerSystem.cs
Last active October 20, 2021 10:05
Entitas Timer System
using Entitas;
using UnityEngine;
public class TimerSystem : IExecuteSystem, ICleanupSystem
{
readonly IGroup<GameEntity> _timers;
readonly IGroup<GameEntity> _timerCompletes;
readonly GameContext _context;
public TimerSystem(Contexts contexts)
@weslleih
weslleih / date.extensions.ts
Last active April 23, 2025 20:15
Extend the TypeScript Date Object with some useful methods
export {}
declare global {
interface Date {
addDays(days: number, useThis?: boolean): Date;
isToday(): boolean;
clone(): Date;
isAnotherMonth(date: Date): boolean;
isWeekend(): boolean;
isSameDate(date: Date): boolean;
@mickdekkers
mickdekkers / SnapshotCamera.cs
Last active December 4, 2024 13:46
Take snapshot images of Prefabs and GameObjects in Unity using Render Textures
using UnityEditor;
using UnityEngine;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
// Object rendering code based on Dave Carlile's "Create a GameObject Image Using Render Textures" post
// Link: http://crappycoding.com/2014/12/create-gameobject-image-using-render-textures/