Memw
Memw
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
Isn't truncating values just casting them to ints?
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
the internal value is simply 00000010
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
the 2.00 is just string formatting
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
well, basically it's what's missing from the Math api that The unity MathF has but the C# Math doesn't
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
No description
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
I love the fact that they are making pull requests to a reference repository, and they make a lot of work for it to never be checked out 😹
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
well, it contains some more methods, but for the methods that are common between these 2 APIs, it uses the C# Math API
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
Here is the source if you want to check that out
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
basically, it internally uses the C# Math API
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
it doesn't really do anything else, it doesn't run faster, it's just a wrapper so you don't need to be casting values every time
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
Yeah, if you don't need floating point arithmetic use Vector2Int
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
even tho it's truncated, they remain floats, and the ToString() method formats them with the F2 format option, and by default I think Debug.Log transforms everything using the ToString() method before printing it, which is what Console.WriteLine in normal C# does, and what makes most sense
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
that's most likely why it does
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
55 replies
CC#
Created by 41phaNum3r1ca1 on 6/4/2024 in #help
Why does this truncated Vector 2 have 2 decimal places
you mean in the debug log?
55 replies
CC#
Created by DarkAngel on 6/2/2024 in #help
text file management
@LostAngel
79 replies
CC#
Created by DarkAngel on 6/2/2024 in #help
text file management
with this you don't call the string interpolation handler two times while checking the file and creating it, and you use the already opened FileStream so you don't close one and open another for no reason
79 replies
CC#
Created by DarkAngel on 6/2/2024 in #help
text file management
string historiqueChemin = $"./datas/Players/{e.Author.Id}/Historique.txt";

if (!File.Exists(historiqueChemin))
{
using FileStream file = File.Create(historiqueChemin);
file.Write(Encoding.UTF8.GetBytes($"Historique des pulls du joueur {p.PlayerName} :"));
}
string historiqueChemin = $"./datas/Players/{e.Author.Id}/Historique.txt";

if (!File.Exists(historiqueChemin))
{
using FileStream file = File.Create(historiqueChemin);
file.Write(Encoding.UTF8.GetBytes($"Historique des pulls du joueur {p.PlayerName} :"));
}
79 replies