Skip to content

Instantly share code, notes, and snippets.

View STARasGAMES's full-sized avatar

Taras STARasGAMES

View GitHub Profile
@runevision
runevision / BurstMethodTester.cs
Last active April 5, 2025 08:05
Using Unity Burst directly on methods without jobs - unofficial example code
using Unity.Burst;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using UnityEngine;
// This example code demonstrates using Unity Burst directly on a static method without jobs.
// Unity NativeArrays can't be used directly in Unity Burst methods (only in Burst jobs),
// so we have to pass pointers to arrays instead.
@FreyaHolmer
FreyaHolmer / AssetCopyUtils.cs
Last active June 12, 2024 07:25
Adds context menu items to assets: Copy/Paste import settings & Copy GUID. Put this script in any Editor/ folder in your project and recompile!
// written by https://github.com/FreyaHolmer so use at your own risk c:
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
/// <summary>Utility functions to copy GUIDs, as well as Copy/Paste import settings</summary>
public static class AssetCopyUtils {
const int CTX_MENU_LOCATION = 70;
@alexanderameye
alexanderameye / CircularMenu.cs
Last active April 28, 2025 08:27
Circular menu for the Unity Editor
/*
MIT License
Copyright (c) [year] [fullname]
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
@yasirkula
yasirkula / CustomRectHandles.cs
Created August 7, 2021 15:15
Drawing Rect handles in Unity (similar to built-in Rect tool)
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
public class CustomRectHandles : ScriptableObject
{
public class Rect3D
{
@bgolus
bgolus / WorldNormalFromDepthTexture.shader
Last active March 5, 2025 00:57
Different methods for getting World Normal from Depth Texture, without any external script dependencies.
Shader "WorldNormalFromDepthTexture"
{
Properties {
[KeywordEnum(3 Tap, 4 Tap, Improved, Accurate)] _ReconstructionMethod ("Normal Reconstruction Method", Float) = 0
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
LOD 100
/*
A simple little editor extension to copy and paste all components
Help from http://answers.unity3d.com/questions/541045/copy-all-components-from-one-character-to-another.html
license: WTFPL (http://www.wtfpl.net/)
author: aeroson
advise: ChessMax
editor: frekons
*/
#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public static class HighlightObjectUtil
{
[MenuItem("CONTEXT/Object/Ping!")]
static void Ping(MenuCommand command)
{
@apkd
apkd / 1-medicine-before.cs
Last active April 4, 2024 09:36
Medicine IL post-processing comparison
using UnityEngine;
using Medicine;
class Player : MonoBehaviour
{
[Inject.Single]
LevelManager levelManager { get; }
[Inject.Single]
Camera mainCamera { get; }
@cjaube
cjaube / RenderingPipelineDefines.cs
Created May 29, 2020 02:38
Generate Unity #define directives for selected rendering pipelines.
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
[InitializeOnLoad]
public class RenderingPipelineDefines
{
enum PipelineType
@JohannesMP
JohannesMP / LICENSE
Last active February 19, 2025 23:39
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*