This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
using UnityEngine.XR.Interaction.Toolkit; | |
public class ResetDraggable : MonoBehaviour | |
{ | |
XRGrabInteractable grabInteractable; | |
Vector3 origPos; | |
Quaternion origRot; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
Use Resource Monitor or SystemInformer https://twitter.com/gf_256/status/1782963162104430898
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api30.tiktokv.com | |
api21.tiktokv.com | |
webcast21.tiktokv.com | |
api31.tiktokv.com | |
api-t1.tiktokv.com | |
webcast1.tiktokv.com | |
api32.tiktokv.com | |
api30-h2.tiktokv.com | |
api21-h2.tiktokv.com | |
api-s1-h2.tiktokv.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Scripts/Editor/ContextMenu/BoxColliderFitChildren.cs | |
// Adjust Box Collider to fit child meshes inside | |
// Usage: You have empty parent transform, with child meshes inside, add box collider to parent then use this | |
// NOTE: Doesnt work if root transform is rotated | |
using UnityEngine; | |
using UnityEditor; | |
namespace UnityLibrary |
NewerOlder