//Brings cube back to default animation state and
    //removes cube if outside camera bounds...
    void OnCLeanup(int sectionIndex)
    {
        if (!gameObject.activeSelf ||
            m_sectionIndex != sectionIndex)
        {
            return;
        }

        m_sectionIndex = -1;
        StopCoroutine(StreamCubes());

        if (m_animator == null)
        {
            m_animator = GetComponentInChildren <Animator>();
        }

        m_animator.SetBool("isEnabled", false);
        m_animator.SetTrigger("cleanup");

        ClipPlanePoints clipPoints = ClipPlanePoints.Instance;

        if (clipPoints.IsOutsideBounds(transform.position))
        {
            Recycle();
        }
    }
Exemple #2
0
    protected override void Update()
    {
        if (m_attractToCamera != null)
        {
            if (AppManager.State != AppManager.AppState.ATTRACT_CUBES)
            {
                ClipPlanePoints clipPoints = ClipPlanePoints.Instance;

                if (clipPoints.IsOutsideBounds(transform.position))
                {
                    Recycle();
                }
                else
                {
                    StopCoroutine(m_attractToCamera);
                    m_attractToCamera = null;

                    m_animator.SetTrigger("cleanup");
                    m_animator.SetBool("isEnabled", false);
                }
            }
        }

        base.Update();
    }