コード例 #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");
            }
        }
コード例 #2
0
 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.");
         }
     }
 }
コード例 #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;
        }
コード例 #4
0
ファイル: StateHandler.cs プロジェクト: Keraunic-Tonic/GJ2021
 /**
  * <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);
 }