it seems that “with (objectname)” it not supported by unity script, right?
I mean the with like in
with (myMath){
x = cos(3 * PI) + sin (LN10)
y = tan(14 * E)
}
Thanks for any help,
Andreas
it seems that “with (objectname)” it not supported by unity script, right?
I mean the with like in
with (myMath){
x = cos(3 * PI) + sin (LN10)
y = tan(14 * E)
}
Thanks for any help,
Andreas
Right such a thing does not exist.
if you want to access something on a specific object you have to specify it on each usage of a value / function on it
Not sure if this helps, but you can at least abbreviate functions:
var m = Mathf();
Debug.Log(m.Abs(-1));
thanks alot, that helps!
Andreas
The import statement might be what you’re looking for:
import UnityEngine.Mathf;
print (PI);
print (Sin(10));
var a = Clamp01(Tan(6));
–Eric
Eric, that’s C# (not Javascript), right?
no thats unity javascript
C# has “using” rather than “import”:
using UnityEngine.Mathf;
–Eric
I forgot all about import.
The more I learn, the more I seem to forget! :lol: