예제 #1
0
파일: Effect.cs 프로젝트: colayue/lingyunji
        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
파일: Effect.cs 프로젝트: colayue/lingyunji
        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;
            }
        }