- 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???)
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/how-to-know-if-a-script-is-running-inside-unity-editor-when-using-device-simulator.921827/ | |
public static class RunMode { | |
public enum ApplicationRunMode { | |
Device, | |
Editor, | |
Simulator | |
} | |
public static ApplicationRunMode Current { | |
get { | |
#if UNITY_EDITOR |
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/stable-fixedupdate-scheduling-plus-motion-interpolation-global-solution.1547513/ | |
using System.Collections.Generic; | |
using UnityEngine; | |
/// <summary> | |
/// This script schedules FixedUpdate() calls globally according to the Hysteresis loop. | |
/// | |
/// How to use FixedUpdateScheduler: | |
/// Simply attach this script to a SINGLE object in the scene. |
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/extension-methods-for-layermask.1605513/ | |
public static void Add(ref this LayerMask mask, int layer) | |
{ | |
mask |= (1 << layer); | |
} | |
public static void Remove(ref this LayerMask mask, int layer) | |
{ | |
mask &= ~(1 << layer); | |
} |
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
### setup without microsoft account | |
- need to be completely disconnected from internet (bypass oobe doesnt work anymore) : Open CMD, "ncpa.cpl" then disable network device. Restart |
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/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; |
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/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 |
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 |
NewerOlder