decentraland / sdk

PM repository for SDK
Apache License 2.0
4 stars 4 forks source link

easingFunction in Tween should be optional #1142

Open nearnshaw opened 2 weeks ago

nearnshaw commented 2 weeks 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
      })