Beispiel #1
0
    /// <summary>
    /// Callback for when the boss died.
    /// </summary>
    private void OnBossDied()
    {
        UnsubscribeFromEvents();

        new ExtendedCoroutine
            (this,
            EnumeratorUtil.FadeGroupCurve(group, healthCurve, healthFadeInTime, true),
            OnHealthHidden,
            true
            );
    }
Beispiel #2
0
    /// <summary>
    /// Displays the name first and then displays the health.
    /// </summary>
    /// <param name="nameDisplayLength">How long the name should display for.</param>
    /// <returns></returns>
    private IEnumerator DoHealthAnimation(float nameDisplayLength)
    {
        nameObject.SetActive(true);

        RectTransform rectTransform = nameObject.transform as RectTransform;

        rectTransform.localPosition = new Vector2(0.0f, 0.0f);
        Vector3 pos = new Vector3(0.0f, -rectTransform.rect.height * 1.5f);

        yield return(EnumeratorUtil.GoToInSecondsLocalCurve(rectTransform, pos, nameCurve, nameDisplayLength));

        nameObject.SetActive(false);

        group.alpha = 0.0f;
        healthObject.SetActive(true);
        yield return(EnumeratorUtil.FadeGroupCurve(group, healthCurve, healthFadeInTime));
    }