Example #1
0
    IEnumerator Focus()
    {
        onPlay              = true;
        m_player.freezed    = true;
        m_player.invincible = true;

        m_camera.fixedTarget = false;
        m_camera.SetTarget(m_focus);
        m_camera.fixedTarget = true;

        while (m_camera.IsFarFromTarget())
        {
            yield return(new WaitForSeconds(.2f));
        }

        if (m_notification.Length > 0)
        {
            GameController.NotifyPlayer(m_notification, m_notificationColor, 2);
        }

        OnFocus();

        yield return(new WaitForSeconds(m_focusTime));

        m_camera.fixedTarget = false;
        m_camera.SetTarget(m_player.transform);
        m_camera.JumpToTarget();

        m_player.freezed    = false;
        m_player.invincible = false;

        onPlay = false;

        if (m_oneTimeOnly)
        {
            saveDestroy = true;
            Save();
        }

        Destroy(gameObject);
    }
Example #2
0
 public void SetCamerTarget()
 {
     _cam.SetTarget(bodyList[bodyList.Count - 1].transform);
 }