Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / jira-ux-issues.md
Created May 23, 2024 14:27
Whats wrong with JIRA (ux issues)

UX

  • When someone posts image into exisiting issue, i cannot see who posted it and it doesnt appear in the message they have sent. (instead, it appears as general attached for the whole issue!) I Have no idea who posted it and i dont understand what image the message refers "what you you think of this image?" (what image???)
@unitycoder
unitycoder / MakeSphereHemisphere.cs
Created May 21, 2024 19:13
Script to create a hemisphere mesh
// https://forum.unity.com/threads/script-to-create-a-hemisphere-mesh.496720/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MakeSphereHemisphere : MonoBehaviour
{
[Header("Sphere Options")]
public float radius = 1f;
@unitycoder
unitycoder / FBXAnimationOrganizer.cs
Created May 10, 2024 07:07
FBX Animation Organizer
// https://forum.unity.com/threads/reordering-fbx-animation-clips.1168847/#post-9825564
/*******************
WARNING: MAKE SURE YOUR METADATA FILES ARE BACKED UP WITH VERSION CONTROL BEFORE USING
Installation:
Copy this C# script into Scripts\Editor.
Usage:
1) To open, go to Window -> FBX Animation Organizer
2) Enter the local directory location of your fbx meta files in the "Directory" field (Right click on the folder in Project window -> Copy Path)
3) Select the meta file to edit from the "File" dropdown
@unitycoder
unitycoder / ResetDraggable.cs
Created May 7, 2024 12:21
Reset Draggable object, unless its placed on socket
using System.Collections;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
public class ResetDraggable : MonoBehaviour
{
XRGrabInteractable grabInteractable;
Vector3 origPos;
Quaternion origRot;
@unitycoder
unitycoder / SetCardPosition.cs
Created May 6, 2024 12:04
align cards on circle edge
// https://discussions.unity.com/t/need-help-with-positioning-while-object-is-rotated/344542/2
private void SetCardPosition(int index)
{
//The angle is based on how far the card is from the midpoint of the hand.
//Note that the midpoint will either be a whole number or x.5
float midpoint = (cards.Count-1) / 2f;
float angle = angleDelta * (midpoint - index);
//Positive angles rotate counterclockwise, negative angles rotate clockwise
cards[index].transform.eulerAngles = new Vector3(0, 0, angle);
@unitycoder
unitycoder / ReelBack.cs
Created April 29, 2024 04:47
Reel Line made from points back
// https://forum.unity.com/threads/coding-a-2d-extendable-and-retractable-fishline.1586673/#post-9801981
private void ReelBack(List<Vector3> points, float reelValue)
{
    if (reelValue <= 0)
        return;
 
    Vector3 origin = points[0];
    float reel = reelValue;
 
    // find cut point
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// @kurtdekker
//
// This is to take any continuous quantity and change it from one value
// to another over time. This code is for floats. It can be adapted to work for:
//
// Vector2, Vector3, Vector3
@unitycoder
unitycoder / TriangleTexturePlugin.cs
Created April 28, 2024 09:17 — forked from daniel-ilett/TriangleTexturePlugin.cs
A Unity editor script which takes a mesh and generates a texture based on the UVs where each triangle is assigned a random greyscale color (place the script inside a folder named Editor).
#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEditor;
using UnityEditor.UIElements;
// Based on: https://forum.unity.com/threads/save-rendertexture-or-texture2d-as-image-file-utility.1325130/
public class TriangleTexturePluginWindow : EditorWindow
@unitycoder
unitycoder / pip.md
Last active April 24, 2024 12:32
pip install errors python linux

(Unity) vertex color importer for MeshLab's OBJ files