Code Monkey home page Code Monkey logo

Comments (9)

Demigiant avatar Demigiant commented on August 20, 2024

Hi,

Not a problem at all, should take me just a short time. Gonna implement them in the next days.

from dotween.

Demigiant avatar Demigiant commented on August 20, 2024

Hey, I implemented it for long, but am having issues with ulong, and I'd need some help.

Obviously, I need to multiply a ulong for a float in order to tween it correctly. That is not a problem, and I end up with a float result that is the correct equivalent of the required ulong.

The problem is between the conversion from float to ulong. Convert.ToUInt64 (as well as casting to ulong) returns a result, absurdly, whose max allowed value is the max value of a long instead than of a ulong. The only thing that works is converting the resulting float FIRST to a string and THEN to a ulong. But the problem with that is that it generates byte allocations every frame because of the string.

Do you have any better idea for the conversion? Am I missing something?

from dotween.

ScriptGeek avatar ScriptGeek commented on August 20, 2024

Thanks for taking a look at this so quickly, I wasn't expecting such a lightning fast response!

I could probably buy some time by using the long data type in the meantime while ulong is being implemented. I'll tinker around a bit and see what I can discover about conversions. Maybe a persistent bit array can be used in the conversion process or maybe there's some other kind of built in conversion trick that will suffice. I'll take a look and see what I can come up with.

from dotween.

Demigiant avatar Demigiant commented on August 20, 2024

Great, that would be very helpful.

In the meantime, you can grab the updated version here. Ulong is implemented too, just with those byte allocations that we don't like.

from dotween.

ScriptGeek avatar ScriptGeek commented on August 20, 2024

Well, I checked it out and I found a solution. Cast the float to a decimal and then the decimal can be multiplied by the ulong. So something like this:

ulong foo = (ulong)(ulong.MaxValue * (decimal)1f;

from dotween.

Demigiant avatar Demigiant commented on August 20, 2024

Nice! Gonna try tomorrow morning :)

from dotween.

Demigiant avatar Demigiant commented on August 20, 2024

Works like a beauty, thanks a lot for the help! New download link coming in next comment

from dotween.

Demigiant avatar Demigiant commented on August 20, 2024

Implemented in v1.0.416

v1.0.416

from dotween.

ScriptGeek avatar ScriptGeek commented on August 20, 2024

Glad I could help, thanks for the awesome support!

from dotween.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.