Example #1
0
        /// <summary>
        /// this method signals a cleanup (duh) and notifies event listeners
        /// </summary>
        private void cleanup()
        {
            if (_instance == null)
            {
                return;
            }

            if (onTransitionComplete != null)
            {
                onTransitionComplete();
            }

            _transitionKitDelegate = null;

            // if we are keeping TK alive we only need to free resources and not delete ourself completely
            if (keepTransitionKitInstance)
            {
                GetComponent <MeshRenderer>().material.mainTexture = null;
                GetComponent <MeshFilter>().mesh = null;
                gameObject.SetActive(false);
                transitionKitCamera.enabled = false;
            }
            else
            {
                Destroy(gameObject);
                _instance = null;
            }
        }
Example #2
0
 /// <summary>
 /// starts up a transition with the given delegate
 /// </summary>
 /// <param name="transitionKitDelegate">Transition kit delegate.</param>
 public void transitionWithDelegate(TransitionKitDelegate transitionKitDelegate)
 {
     gameObject.SetActive(true);
     _transitionKitDelegate = transitionKitDelegate;
     initialize();
 }