Skip to content

Instantly share code, notes, and snippets.

View SimonDarksideJ's full-sized avatar

Simon (Darkside) Jackson SimonDarksideJ

View GitHub Profile
@FronkonGames
FronkonGames / TinyTween.cs
Created October 30, 2022 23:20
A Complete and Easy to use Tweens library in One File.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// _____ _ _____
// |_ _|_|___ _ _ |_ _|_ _ _ ___ ___ ___
// | | | | | | | | | | | | | -_| -_| |
// |_| |_|_|_|_ | |_| |_____|___|___|_|_|
// |___|
// A Complete and Easy to use Tweens library in One File
//
// Basic use:
@SimonDarksideJ
SimonDarksideJ / DragManipulator.cs
Created October 20, 2022 11:16 — forked from shanecelis/DragManipulator.cs
This manipulator makes a visual element draggable at runtime in Unity's UIToolkit.
/* Original code[1] Copyright (c) 2022 Shane Celis[2]
Licensed under the MIT License[3]
[1]: https://gist.github.com/shanecelis/b6fb3fe8ed5356be1a3aeeb9e7d2c145
[2]: https://twitter.com/shanecelis
[3]: https://opensource.org/licenses/MIT
*/
using UnityEngine;
using UnityEngine.UIElements;
@shanecelis
shanecelis / DragManipulator.cs
Last active June 27, 2024 10:47
This manipulator makes a visual element draggable at runtime in Unity's UIToolkit.
/* Original code[1] Copyright (c) 2022 Shane Celis[2]
Licensed under the MIT License[3]
[1]: https://gist.github.com/shanecelis/b6fb3fe8ed5356be1a3aeeb9e7d2c145
[2]: https://twitter.com/shanecelis
[3]: https://opensource.org/licenses/MIT
*/
using UnityEngine;
using UnityEngine.UIElements;
@pencilking2002
pencilking2002 / ScriptableObjectWindow.cs
Created May 21, 2019 19:43
View and edit all your Scriptable Objects in a single Editor Window
using UnityEngine;
using UnityEditor;
using Object = UnityEngine.Object;
using System;
// DESCRIPTION
// This is a Unity editor script that allows you to view and edit all your Scriptable Objects in one Editor Window
// INSTRUCTIONS
// In Unity, place this file in an Editor folder.
@playatwork
playatwork / SimplexNoise3Node.cs
Last active October 26, 2020 17:08
Simplex noise custom node for Shader Graph
//
// Simplex noise custom node for Shader Graph
//
// Original work (webgl-noise) Copyright (C) 2011 Ashima Arts.
// Translation and modification was made by Keijiro Takahashi.
// Ported to Shader Graph by Sergio L. Valladares
//
// This shader is based on the webgl-noise GLSL shader. For further details
// of the original shader, please see the following description from the
// original source code.
@jonHuffman
jonHuffman / SceneConstantsGenerator.cs
Last active September 3, 2018 20:53
A utility script for Unity that generates a constants file for the scenes listed in the build settings. Can be accessed under Tools/Code Generation/Create Scene Constants
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version: 15.0.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
namespace CodeGeneration.Constants
@CheapDevotion
CheapDevotion / BVHImporter.cs
Last active June 12, 2023 18:42
A simple Unity Editor utility that converts bvh (animation) files to fbx using the Blender Python API and imports them into your project.
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Diagnostics;
public class BVHImporter : EditorWindow {
public const string BLENDER_EXEC = @"C:\Program Files\Blender Foundation\Blender\blender.exe";
public const string PHYTHON_CODE = @"import bpy;import sys;argv = sys.argv;argv = argv[argv.index(\""--\"") + 1:];bvh_in = argv[0];fbx_out = argv[0] + \"".fbx\"";objs = bpy.data.objects;bpy.ops.import_anim.bvh(filepath=bvh_in, filter_glob=\""*.bvh\"", global_scale=1, frame_start=1, use_fps_scale=False, use_cyclic=False, rotate_mode='NATIVE', axis_forward='-Z', axis_up='Y');objs.remove(objs[\""Cube\""], True);objs.remove(objs[\""Lamp\""], True);objs.remove(objs[\""Camera\""], True);bpy.ops.export_scene.fbx(filepath=fbx_out, axis_forward='-Z', axis_up='Y', use_anim=True, use_selection=True, use_default_take=False);";
@rstecca
rstecca / MakeA3DObjectDraggable.cs
Last active September 29, 2021 11:32
How to make a 3D object draggable in Unity3D
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
/*
MAKE A 3D OBJECT DRAGGABLE
Riccardo Stecca
http://www.riccardostecca.net
@michaelarts
michaelarts / XboxOneUWP.cs
Last active June 18, 2024 12:08
A static class that implements all basic functionality needed for a UWP Xbox One game. If you're releasing through ID@Xbox you'll be required to do some of these things. Just include this class in your project and start calling the functions! Enjoy!
using System;
using System.Collections.Generic;
using Windows.System;
using Windows.Storage.Streams;
using Windows.Services.Store;
using Windows.Gaming.XboxLive.Storage;
using Microsoft.Xbox.Services;
using Microsoft.Xbox.Services.System;
using Microsoft.Xbox.Services.Presence;
using Microsoft.Xbox.Services.Statistics.Manager;
@andrew-raphael-lukasik
andrew-raphael-lukasik / Wait.cs
Last active December 28, 2022 23:32
WaitForSeconds cached means less memory allocations because of coroutines
//Usage example:
//yield return Wait.t2s5;//waits 2.5 seconds
using UnityEngine;
public class Wait
{
public readonly static object frame = null;
public readonly static WaitForEndOfFrame endOfFrame = new WaitForEndOfFrame();
public readonly static WaitForFixedUpdate fixedUpdate = new WaitForFixedUpdate();