Skip to content

Instantly share code, notes, and snippets.

View diliupg's full-sized avatar

Diliup Gabadamudalige diliupg

View GitHub Profile
@mstevenson
mstevenson / ConfigurableJointExtensions.cs
Last active July 18, 2024 07:16
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) {
@jasursadikov
jasursadikov / vscode-unity-settings.json
Last active June 27, 2024 13:41
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,