Exemple #1
0
 protected override void Awake()
 {
     //Debug.Log("GF_Awake()");
     currentCanvas.BroadcastMessage("setPlayer");
     cam = Camera.main;
     sfx = cam.GetComponents<AudioSource>();
 }
        private void CleanCamera(Camera camera)
        {
            Component[] cameraComponents = camera.GetComponents<Component>();
            for (int i = 0; i < cameraComponents.Length; i++)
            {
                if (Utilities.IsForbiddenComponent(camera, cameraComponents[i]))
                    continue;

                DestroyImmediate(cameraComponents[i]);
            }
        }
        /// <summary>
        /// Draws a list of all the components that are on the SceneView's camera for debugging purposes
        /// </summary>
        /// <param name="sceneCamera">The camera we're drawing the list for</param>
        private static void DrawCameraPostFx(Camera sceneCamera)
        {
            EditorGUILayout.BeginVertical("box");
            {
                BeholdR.ActiveInstance.ShowCameraComponents = EditorGUILayout.Foldout(BeholdR.ActiveInstance.ShowCameraComponents, "Camera Components");
                if(BeholdR.ActiveInstance.ShowCameraComponents)
                {
                    EditorGUI.indentLevel += 2;

                    foreach(Component component in sceneCamera.GetComponents<Component>())
                    {
                        EditorGUILayout.LabelField(component.GetType().Name);
                    }

                    EditorGUI.indentLevel -= 2;
                }
            }
            EditorGUILayout.EndVertical();
        }
Exemple #4
0
        /// <summary>
        /// In case we have a difference between the scene camera and our list, re-sync to list
        /// </summary>
        private static void CleanMissingPostEffects(Camera sceneCamera)
        {
            if(sceneCamera == null) return;

            List<Component> wipeList = new List<Component>(sceneCamera.GetComponents<Component>());

            foreach(Component component in wipeList)
            {
                if(Utilities.IsForbiddenComponent(sceneCamera, component)) continue;

                DestroyImmediate(component);
            }
        }