void Start() { //Implements Singleton if (currentCamera != null) { Debug.LogError("Can't have more than one camera!"); return; } _retroPixelShader = GetComponent <AlpacaSound.RetroPixel>(); _blurShader = GetComponent <BlurEffect>(); currentCamera = this; _mainCamera = gameObject.camera; }
/** * initializes everything needed for seebright * Called specifically from Game Manager class */ public void initSeebright() { if (_SBLHS != null || _SBRHS != null) { Debug.LogError("Already enabled seebright for camera controller!"); return; } SBCamera sbCamera = GetComponent <SBCamera>(); if (sbCamera == null) { Debug.LogError("No Seebright Camera attached to main camera object!"); return; } sbCamera.enabled = true; //return if it just got enabled for the first time if (sbCamera.sbLeftCamera == null || sbCamera.sbRightCamera == null) { return; } _SBLHS = sbCamera.sbLeftCamera.GetComponentInChildren <Camera>(); _SBRHS = sbCamera.sbRightCamera.GetComponentInChildren <Camera>(); //Get RetroPixel shaders _retroPixelShaderLHS = _SBLHS.gameObject.AddComponent <AlpacaSound.RetroPixel>(); _retroPixelShaderRHS = _SBRHS.gameObject.AddComponent <AlpacaSound.RetroPixel>(); _retroPixelShaderLHS.enabled = false; _retroPixelShaderRHS.enabled = false; //Blur shader _blurShaderLHS = _SBLHS.gameObject.AddComponent <BlurEffect>(); _blurShaderRHS = _SBRHS.gameObject.AddComponent <BlurEffect>(); _blurShaderLHS.blurShader = (Shader)Resources.Load("Shaders/BlurEffectConeTaps"); _blurShaderRHS.blurShader = (Shader)Resources.Load("Shaders/BlurEffectConeTaps"); _blurShaderLHS.enabled = false; _blurShaderRHS.enabled = false; //Fast Bloom shaders //_SBLHS.gameObject.AddComponent<FastBloom>(); }
override public void OnInspectorGUI() { serObj.Update(); RetroPixel target = (RetroPixel)GameObject.FindGameObjectWithTag("MainCamera").GetComponent(typeof(RetroPixel)); horizontalResolution.intValue = EditorGUILayout.IntField("Horizontal Resolution", horizontalResolution.intValue); verticalResolution.intValue = EditorGUILayout.IntField("Vertical Resolution", verticalResolution.intValue); numColors.intValue = EditorGUILayout.IntSlider("Number of colors", numColors.intValue, 2, RetroPixel.MAX_NUM_COLORS); for (int i = 0; i < numColors.intValue; i++) { colors.GetArrayElementAtIndex(i).colorValue = EditorGUILayout.ColorField("Color " + i, colors.GetArrayElementAtIndex(i).colorValue); } if (GUILayout.Button("Reset colors")) { target.ResetColors(); } serObj.ApplyModifiedProperties(); }
/** * initializes everything needed for seebright * Called specifically from Game Manager class */ public void initSeebright() { if(_SBLHS != null || _SBRHS != null) { Debug.LogError("Already enabled seebright for camera controller!"); return; } SBCamera sbCamera = GetComponent<SBCamera>(); if(sbCamera == null) { Debug.LogError("No Seebright Camera attached to main camera object!"); return; } sbCamera.enabled = true; //return if it just got enabled for the first time if(sbCamera.sbLeftCamera == null || sbCamera.sbRightCamera == null) { return; } _SBLHS = sbCamera.sbLeftCamera.GetComponentInChildren<Camera>(); _SBRHS = sbCamera.sbRightCamera.GetComponentInChildren<Camera>(); //Get RetroPixel shaders _retroPixelShaderLHS = _SBLHS.gameObject.AddComponent<AlpacaSound.RetroPixel>(); _retroPixelShaderRHS = _SBRHS.gameObject.AddComponent<AlpacaSound.RetroPixel>(); _retroPixelShaderLHS.enabled = false; _retroPixelShaderRHS.enabled = false; //Blur shader _blurShaderLHS = _SBLHS.gameObject.AddComponent<BlurEffect>(); _blurShaderRHS = _SBRHS.gameObject.AddComponent<BlurEffect>(); _blurShaderLHS.blurShader = (Shader)Resources.Load("Shaders/BlurEffectConeTaps"); _blurShaderRHS.blurShader = (Shader)Resources.Load("Shaders/BlurEffectConeTaps"); _blurShaderLHS.enabled = false; _blurShaderRHS.enabled = false; //Fast Bloom shaders //_SBLHS.gameObject.AddComponent<FastBloom>(); }
void Start() { //Implements Singleton if(currentCamera != null) { Debug.LogError("Can't have more than one camera!"); return; } _retroPixelShader = GetComponent<AlpacaSound.RetroPixel>(); _blurShader = GetComponent<BlurEffect>(); currentCamera = this; _mainCamera = gameObject.camera; }
// public float pulseSpeed; // public float pulseRange; // Use this for initialization void Start() { retroPixel = fpsCharacter.GetComponent <AlpacaSound.RetroPixel> (); }
// public float pulseSpeed; // public float pulseRange; // Use this for initialization void Start() { retroPixel = fpsCharacter.GetComponent<AlpacaSound.RetroPixel> (); }