Skip to content

Instantly share code, notes, and snippets.

View nukadelic's full-sized avatar
☣️

Nukadelic nukadelic

☣️
View GitHub Profile
@antonkudin
antonkudin / pipeGenerator.cs
Created September 26, 2023 13:48
Generates pipe mesh from mesh segments
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class pipeGenerator : MonoBehaviour
{
[SerializeField] Mesh straightMesh;
[SerializeField] Mesh elbowMesh;
[Space]
[SerializeField] Vector3[] pathPoints;
@runevision
runevision / Unity versions not affected by Unity Runtime Fee.md
Created September 14, 2023 09:45
Unity versions not affected by Unity Runtime Fee

Unity versions not affected by Unity Runtime Fee

This is information that has been dug up by me and others in the Unity community. It's not official information from Unity (but most of the linked resources are). It is also not legal advise. I am not a lawyer.

TLDR:

Contrary to what Unity themselves are saying, for games made with these Unity versions, developers can elect not to be affected by a newer version of the Terms of Service that introduces the Unity Runtime Fee:

  • Unity 2022.x or earlier
  • Unity 2021.x LTS or earlier
@katas94
katas94 / WorldSpaceUIDocument.cs
Created October 27, 2021 19:11
Custom Unity component to create a world-space UIToolkit panel
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEngine.EventSystems;
using UnityEngine.Rendering;
namespace Katas.Experimental
{
public class WorldSpaceUIDocument : MonoBehaviour, IPointerMoveHandler, IPointerUpHandler, IPointerDownHandler,
ISubmitHandler, ICancelHandler, IMoveHandler, IScrollHandler, ISelectHandler, IDeselectHandler, IDragHandler
@jtmcdole
jtmcdole / capCarve.py
Last active March 26, 2024 20:03
Blender carving a keycap
# Carve legends into keycaps.
#
# This script uses Intersect (knife) to make accurate cuts. The downside is you need to convert
# a text object into a mesh and extrude by just the right amount. We can do this for caps since
# we know how tall the cap-well is.
#
# Unlike knife-project; this doesn't mess with context, view3d, projections, etc.
#
# TODO: save some custom data to layout the keyboard for renderin.
import bpy
@DuncanF
DuncanF / gist:353509dd397ea5f292fa52d1b9b5133d
Created January 29, 2020 10:43
Unity lockless (no GPU readback) marching cubes via Graphics.DrawProceduralIndirect - some slight faffing because compute shader must append full triangle (3 verts) at a time to render correctly, but this means the appendbuffer count is 3 times smaller than it needs to be, so we have to invoke a very short compute shader (FixupIndirectArgs) just…
MarchingCubesGPU.cs:
...
// DrawProceduralIndirect
ComputeBuffer argsBuffer;
[StructLayout(LayoutKind.Sequential)]
struct DrawCallArgBuffer
{
public const int size =
sizeof(int) +
sizeof(int) +
@jeffvella
jeffvella / RaycastUnderPointerSystem.cs
Created July 16, 2019 07:18
Unity Physics in ECS Raycasting
using BovineLabs.Entities.Systems;
using Unity.Burst;
using Unity.Entities;
using Unity.Jobs;
using Unity.Collections;
using Unity.Physics;
using Unity.Physics.Systems;
using UnityEngine;
[UpdateAfter(typeof(BuildPhysicsWorld)), UpdateBefore(typeof(EndFramePhysicsSystem))]
@ditzel
ditzel / PhysicsHelper.cs
Created January 20, 2019 16:54
Unity Helper for Physic Functions
using UnityEngine;
namespace Ditzelgames
{
public static class PhysicsHelper
{
public static void ApplyForceToReachVelocity(Rigidbody rigidbody, Vector3 velocity, float force = 1, ForceMode mode = ForceMode.Force)
{
if (force == 0 || velocity.magnitude == 0)
@YumaInaura
YumaInaura / README.md
Last active November 21, 2023 05:48
Gist — Manage in one repository many gists by using git submodule

Gist — Manage in one repository many gists by using git submodule

Gist is a nice service. We can write code so easily and manage files as repository.

But bad points are …

  • Many repository
  • Gist destributes random hash to perticular gists (repositories).
  • So difficult to find or remember contents as repository.
@ssshake
ssshake / isWrit
Last active September 29, 2023 06:15
Photon PUN Cheat Sheet
## Photon Methods
**public class Blank : Photon.PunBehaviour**
instead of mono behavior, use this to receive photon callbacks in your script.
**public override void OnLeftRoom()**
An example of overriding a punbehavior callback
@neozero
neozero / main.cpp
Last active November 19, 2023 18:31
OculusHomeless - Use Oculus Dash without Home 2.0
/************************************************************************************
Content : First-person view test application for Oculus Rift
Created : 19th June 2015
Authors : Tom Heath
Copyright : Copyright 2015 Oculus, Inc. All Rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at