Quantcast
Channel: Latest Questions by Ubahs
Viewing all articles
Browse latest Browse all 4

Best Practices: TimeSpans

$
0
0
Hi there, this is, hopefully, a simple question. Why do I not see TimeSpans in tutorials/examples more? Are using these considered a bad practice? I know all sorts of nifty things can be done with just plain ol' floats and Time.deltaTime, but very little seems to fit the elegance (in my opinion) of something like: timeInAir += TimeSpan.FromSeconds(Time.deltaTime); I'm still new to Unity, but I'm afraid of building bad habits now if I should be staying away from TimeSpans/DateTimes. Are these just not used a lot because not everyone comes from a C# background and is used to these futuristic objects? Specifically, I'm wondering if: 1. Are they performant (across all platforms)? 2. Do they work across all platforms? 3. Do they ever not work the way they should (from MS C# background) in Unity's custom .net compiler setup? Sorry if this isn't considered constructive, but I think Best Practices are rather important to nail down early. Thanks.

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>