Using Rider, I’m trying to do matrix things with unity, however for some reason suddenly Rider will only let me type the System.Numerics.Matrix4x4 instead of the Unity one.
Can I force it to use the Unity one without typing UnityEngine.Matrix4x4 every time?
I tried cycling through autocomplete. Rider does not give me the option to swap to Unity Engine 4×4 Matrix struct.
To start your scrip you should use
using UnityMatrix4x4 = UnityEngine.Matrix4x4;
example:
using UnityEngine;
using UnityMatrix4x4 = UnityEngine.Matrix4x4;
public class ExScript : MonoBehaviour
{
void Start()
{
UnityMatrix4x4 matrix = new UnityMatrix4x4();
// able matrix
}
}
joana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
From rider’s website you can exclude some items from the list.
This is of course only a viable solution if you never want to use the other Matrix4x4
, which I imagine is the case in this instance.
You may want some types or namespaces not to be suggested, for example, if you have something similar to a system type in your solution, say MyFramework.MyCollections.List, but you are not actually using it. To exclude such items from the suggestions, add them to the Exclude from import and completion list on the Editor | General | Auto Import page of JetBrains Rider settings CtrlAlt
0S
.
The format of the entries is Fully.Qualified.Name, Fully.Qualified.Name.Prefix*, or *Fully.Qualified.Name.Suffix. Generic types are specified as List`1.
1
Just fixed it. I think by accidentally selecting System.Numerics.Matrix4x4 once in intellisense, it automatically put
using Matrix4x4 = System.Numerics.Matrix4x4;
in the using header.
Deleted that line, and cleared intellisense cache (in File> Invalidate Caches) and it’s recommending the unity engine matrices again.