Exemplo n.º 1
0
        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.");
         }
     }
 }
Exemplo n.º 3
0
        /**
         * <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;
        }
Exemplo n.º 4
0
 /**
  * <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);
 }