private void SetBackgroundCameraFarClipPlane(float value) { BackgroundCamera backgroundCamera = Object.FindObjectOfType <BackgroundCamera>(); if (backgroundCamera) { backgroundCamera.GetComponent <Camera>().farClipPlane = value; } else { ACDebug.LogWarning("Cannot find BackgroundCamera"); } }
protected void AssignCamera() { if (canvas.worldCamera == null) { BackgroundCamera backgroundCamera = Object.FindObjectOfType <BackgroundCamera>(); if (backgroundCamera != null) { canvas.worldCamera = backgroundCamera.GetComponent <Camera>(); } else { ACDebug.LogWarning("No 'BackgroundCamera' found - is it present in the scene? If not, drag it in from /AdventureCreator/Prefabs/Automatic."); } } }
/** * <summary>Sets the RawImage component's texture to a given texture</summary> * <param name = "texture">The texture to assign</param> */ public void SetTexture(Texture texture) { if (texture == null) { return; } if (canvas.worldCamera == null) { BackgroundCamera backgroundCamera = Object.FindObjectOfType <BackgroundCamera>(); if (backgroundCamera != null) { canvas.worldCamera = backgroundCamera.GetComponent <Camera>(); } else { ACDebug.LogWarning("No 'BackgroundCamera' found - is it present in the scene? If not, drag it in from /AdventureCreator/Prefabs/Automatic."); } } rawImage.texture = texture; }
/** * <summary>Unregisters a BackgroundCamera, so that it is no longer updated</summary> * <param name = "_object">The BackgroundCamera to unregister</param> */ public void Unregister(BackgroundCamera _object) { backgroundCameras.Remove(_object); }