Answer by idbrii
Turns out that even [back on 5.6, the documentation says:](https://docs.unity3d.com/560/Documentation/ScriptReference/PropertyDrawer.html)> Note that for performance reasons, EditorGUILayout...
View ArticleAnswer by idbrii
> I want to use the auto layout system> to make things easier on myself> (basically using static methods from> "EditorGUILayout" instead of> "EditorGUI") but this results in the>...
View ArticleAnswer by idbrii
I had the same ArgumentException problem and it turns out the [documentation for PropertyDrawer](https://docs.unity3d.com/ScriptReference/PropertyDrawer.html) says:> Note that for performance...
View ArticleAnswer by idbrii
Another reason ArgumentException can be happening is from trying to use EditorGUILayout functions in PropertyDrawers. It turns out the [documentation for...
View ArticleAnswer by idbrii
Here's my attempt at making functions to apply stretch anchors: public static void SetStretchAnchorAll(RectTransform t) { t.pivot = Vector2.one * 0.5f; t.anchorMin = Vector2.zero; t.anchorMax =...
View ArticleAnswer by idbrii
Similar answer but instead of Object.FindObjectsOfType(typeof(GameObject)), use SceneManager.GetActiveScene().GetRootGameObjects() so you only look at each object once. (FindObjectsOfType should find...
View ArticleAnswer by idbrii
In more recent versions of Unity (2019) and UI.Text, it looks like the new solution is [TextGenerator][1]. [1]: https://docs.unity3d.com/ScriptReference/TextGenerator.html
View ArticleAnswer by idbrii
To add to VesuvianPrime's great answer, since you have a Transform, you can use **localToWorldMatrix** to create your matrix. I think it's the same as `Matrix4x4.TRS(transform.position,...
View ArticleAnswer by idbrii
Try using the free [Navmesh Cleaner](https://assetstore.unity.com/packages/tools/ai/navmesh-cleaner-151501) asset. It automatically creates NonWalkable volumes around areas that don't seem reachable....
View ArticleAnswer by idbrii
> i want to create a copy of the drawn linerenderer of every frame or second Where you do this: lRenderer.SetPosition(i, cubePos - goTransform.position); Save the position in a Vector3[]:...
View ArticleAnswer by idbrii
Probably the best you can do is copy how [NavMeshSurface.BuildNavMesh](https://github.com/Unity-Technologies/NavMeshComponents/blob/master/Assets/NavMeshComponents/Scripts/NavMeshSurface.cs#L159-L182)...
View ArticleAnswer by idbrii
> There is no way to do an automatic connection between two navmesh surface component Try [unity-navgen][1] or one of the linked alternatives. >> if it's possible to fall from a surface...
View ArticleAnswer by idbrii
Duplicating my platform and moving it away from a wall got navmesh to generate on top of it. I think the reason is hinted by the [Tile Size documentation][1]: > The NavMesh is built in square tiles...
View ArticleAnswer by idbrii
An expansion on @bjennings76 's answer that uses the fill anchor for RectTransforms: public static class Shortcuts { [MenuItem("GameObject/Group Selected %g")] private static void GroupSelected() { if...
View ArticleAnswer by idbrii
You should be able to make it readable by enabling "Read/Write Enabled" in the atlas's Import Settings inspector.
View ArticleAnswer by idbrii
You need to assign scrollPosition to your Vector2 for the scrollview's scrolling to be stored between frames. For some reason, ScrollViewScope doesn't do this automatically. See below for a subclass of...
View ArticleAnswer by idbrii
SpriteRenderer has a flip checkbox to mirror it. ![](https://forum.unity.com/attachments/upload_2015-12-24_15-27-27-png.167111/) Answer from...
View ArticleAnswer by idbrii
Honestly, one of the easiest/most foolproof ways is to add a TMPro.TextMeshPro to your prefab. You can position it relative to the object, it generates easy to read text, and it's easy to change the...
View ArticleAnswer by idbrii
From [the forum post "returning a byte array to c# from objc"](https://forum.unity.com/threads/returning-a-byte-array-to-c-from-objc.93503/#post-6833597): # Obj-C Bundle is called PluginName.bundle //...
View ArticleAnswer by idbrii
You can get an array of bytes from an NSBitmapImageRep. However, there's some hoops to jump through to get one of those from an NSImage. You'll also want to resize the image to avoid getting back a...
View ArticleAnswer by idbrii
[HingeJoint2D has angle limits][1]. You can use those to prevent 360 rotation. You could check [jointAngle](https://docs.unity3d.com/ScriptReference/HingeJoint2D-jointAngle.html) in Update() for when...
View ArticleAnswer by idbrii
If you put your object under a parent that sets the world position, you can offset the localPosition to give it shake and when your offset goes to zero your object will return to the neutral position....
View ArticleAnswer by idbrii
In your code, you could add `myCamera.localPosition = originalCamPos` before yield break. If you put your object under a parent that sets the world position, you can offset the localPosition to give it...
View ArticleAnswer by idbrii
If you put your object under a parent that sets the world position, you can offset the localPosition to give it shake and when your offset goes to zero your object will return to the neutral position....
View ArticleAnswer by idbrii
If you put your object under a parent that sets the world position, you can offset the localPosition to give it shake and when your offset goes to zero your object will return to the neutral position....
View ArticleAnswer by idbrii
If you put your object under a parent that sets the world position, you can offset the localPosition to give it shake and when your offset goes to zero your object will return to the neutral position....
View ArticleAnswer by idbrii
If you don't want to write your own PropertyDrawer, you can use [NaughtyAttributes.Label][1]: public class Luces : MonoBehaviour { [Header("Luces")] [Label("Roja")] public Light luzRoja; // ......
View ArticleAnswer by idbrii
You're missing a call to [Camera.Render][1] and [Texture2D.Apply][2]. Something like this should work: public Texture2D ToTexture2D(RenderTexture rTex) { RenderTexture currentActiveRT =...
View ArticleAnswer by idbrii
Setup an orthographic camera where the size is set to the z of the bounds and render to a render texture with the same aspect ratio as the bounds. Here's my solution: public RawImage _MapImage; //...
View ArticleAnswer by idbrii
InverseLerp finds the **progress** between two values. For `InverseLerp(float a, float b, float value)`, *a* is the start, *b* is the end, *value* is the current position. It returns how far along the...
View Article
More Pages to Explore .....