Skip to content

Instantly share code, notes, and snippets.

View diliupg's full-sized avatar

Diliup Gabadamudalige diliupg

View GitHub Profile
@jasursadikov
jasursadikov / vscode-unity-settings.jsonc
Last active January 30, 2025 13:07
VSCode files exclusion mask for Unity project
// This file should be placed in the root direcotry inside your Unity project directory like following /.vscode/settings.json
{
"files.exclude": {
// Root directory
"[Bb]uild/": true,
"[Bb]uilds/": true,
"[L]ibrary/": true,
"[Ll]ogs/": true,
"[Oo]bj/": true,
"[Tt]emp/": true,
@mstevenson
mstevenson / ConfigurableJointExtensions.cs
Last active March 26, 2025 03:55
Unity extension methods for computing a ConfigurableJoint.TargetRotation value from a given local or world rotation.
using UnityEngine;
public static class ConfigurableJointExtensions {
/// <summary>
/// Sets a joint's targetRotation to match a given local rotation.
/// The joint transform's local rotation must be cached on Start and passed into this method.
/// </summary>
public static void SetTargetRotationLocal (this ConfigurableJoint joint, Quaternion targetLocalRotation, Quaternion startLocalRotation)
{
if (joint.configuredInWorldSpace) {