示例#1
0
        public void LateUpdate()
        {
            Camera nowcurrent = cameraStruct.GetCurrent(root);

            if (nowcurrent == null)
            {
                OnRemove();
                return;
            }

            if (current != null && current.Camera == nowcurrent)
            {
                return;
            }

            OnRemove();
            current         = nowcurrent.gameObject.AddComponent <CameraEffects>();
            current.current = parent;
        }
示例#2
0
        public void OnRemove()
        {
            if (current != null)
            {
                parent.RestoreCamera();
#if UNITY_EDITOR
                if (!Application.isPlaying)
                {
                    UnityEngine.Object.DestroyImmediate(current);
                }
                else
                {
                    UnityEngine.Object.Destroy(current);
                }
#else
                UnityEngine.Object.Destroy(current);
#endif
                current = null;
            }
        }