Source Code Progress as of Day 4

GitHub - yjlintw/Tweenie at blog-day4

Bug-Fix Exception handling when tweener associated object is destroyed

The previous code had a problem where if a tweener was still running but the tweener-associated object was destroyed, it would result in a MissingReferenceException. To address this issue, we have implemented exception handling using a Try/Catch block when updating the parameters. In the event of an exception, the Tweener will now destroy itself.

The updated code resolves this problem by implementing the following changes:


bool TrySetParam(T value)
{
    try
    {
        Param(value);
    }
    catch (MissingReferenceException e)
    {
        Debug.Log($"The parameter this tweener is setting is missing. " +
                  "Don't worry. Tweenie handles it. This tweener will be destroy in next frame.\\n" +
                  $"{e.Message}");
        Destroy();
        return false;
    }
    catch (Exception e)
    {
        Debug.LogError(e);
        Destroy();
        return false;
    }

    return true;
}

New Tweenie Status in Inspector

I added a status field in the Tweenie Inspector to show the current number of active tweeners. This allows you to easily monitor the active tweeners directly from the Inspector.

Untitled

New Added package.json file

To try the package in Unity through UPM. Adding it using this URL

<https://github.com/yjlintw/Tweenie.git?path=/Assets/Tweenie>

Todo List

Not in any particular order

Tween Control

Looping

Animation

Optimization

Quality of Life

Testing

Refactor