decentraland / creator-hub

MIT License
0 stars 4 forks source link

easingFunction in Tween should be optional #156

Open nearnshaw opened 1 month ago

nearnshaw commented 1 month ago

When creating a Tween, I always need to pass a value for easingFunction.

80% of scenes will surely just use linear tweens. This introduces fairly advanced concepts that will most of the time not be needed. It also requires an extra import of the EasingFunction enum.

The Tween in the Utils library had this field as optional, and that made a ton of sense. We should make it optional in the Tween component too.

Instead of writing this:

      Tween.create(avocado, {
        mode: Tween.Mode.Scale(
          { start: Vector3.One(), 
            end: Vector3.Zero() }),
          duration: 500,
          easingFunction: EasingFunction.EF_LINEAR
      })

I want to write this:

      Tween.create(avocado, {
        mode: Tween.Mode.Scale(
          { start: Vector3.One(), 
            end: Vector3.Zero() }),
          duration: 500
      })