<commit_before>﻿//Enhanced Sky for Daggerfall Tools for Unity by Lypyl, contact at <EMAIL>
//http://www.reddit.com/r/dftfu
//http://www.dfworkshop.net/
//Author: LypyL
///Contact: <EMAIL>
//License: MIT License (http://www.opensource.org/licenses/mit-license.php)



using UnityEngine;

//using DaggerfallConnect;
//using DaggerfallConnect.Arena2;
//using DaggerfallConnect.Utility;
using DaggerfallWorkshop;
using DaggerfallWorkshop.Utility;

namespace EnhancedSky
{
    public class SkyCam : MonoBehaviour
    {
        public GameObject mainCamera;
        public Camera skyCamera;

        // Use this for initialization
        void Start()
        {
            if(!skyCamera)
                skyCamera = this.GetComponent<Camera>();
            if (!mainCamera)
                mainCamera = DaggerfallWorkshop.Game.GameManager.Instance.MainCameraObject;

            //SkyCamera.renderingPath = MainCamera.GetComponent<Camera>().renderingPath;
            GetCameraSettings();

        }

        void LateUpdate()
        {
            this.transform.rotation = mainCamera.transform.rotation;
        }

        void GetCameraSettings()
        {
            Camera mainCam = mainCamera.GetComponent<Camera>();
            if(mainCam)
            {
                skyCamera.renderingPath = mainCam.renderingPath;
                skyCamera.fieldOfView = mainCam.fieldOfView;

            }
            else
            {
                Debug.Log("Using default settings for SkyCamera");
                skyCamera.fieldOfView = 65;
                skyCamera.renderingPath = RenderingPath.DeferredShading;

            }
            

            if (DaggerfallUnity.Settings.RetroRenderingMode > 0)
            {
                skyCamera.targetTexture = DaggerfallWorkshop.Game.GameManager.Instance.RetroRenderer.RetroTexture;
            }
<commit_msg>Support switching retro mode render target at runtime<commit_after>﻿//Enhanced Sky for Daggerfall Tools for Unity by Lypyl, contact at <EMAIL>
//http://www.reddit.com/r/dftfu
//http://www.dfworkshop.net/
//Author: LypyL
///Contact: <EMAIL>
//License: MIT License (http://www.opensource.org/licenses/mit-license.php)



using UnityEngine;

//using DaggerfallConnect;
//using DaggerfallConnect.Arena2;
//using DaggerfallConnect.Utility;
using DaggerfallWorkshop;
using DaggerfallWorkshop.Utility;

namespace EnhancedSky
{
    public class SkyCam : MonoBehaviour
    {
        public GameObject mainCamera;
        public Camera skyCamera;

        int lastRetroMode = -1;

        // Use this for initialization
        void Start()
        {
            if(!skyCamera)
                skyCamera = this.GetComponent<Camera>();
            if (!mainCamera)
                mainCamera = DaggerfallWorkshop.Game.GameManager.Instance.MainCameraObject;

            //SkyCamera.renderingPath = MainCamera.GetComponent<Camera>().renderingPath;
            GetCameraSettings();

        }

        private void Update()
        {
            if (DaggerfallUnity.Settings.RetroRenderingMode != lastRetroMode)
            {
                if (skyCamera && DaggerfallUnity.Settings.RetroRenderingMode != 0)
                    skyCamera.targetTexture = DaggerfallWorkshop.Game.GameManager.Instance.RetroRenderer.RetroTexture;
                else
                    skyCamera.targetTexture = null;

                lastRetroMode = DaggerfallUnity.Settings.RetroRenderingMode;
            }
        }

        void LateUpdate()
        {
            this.transform.rotation = mainCamera.transform.rotation;
        }

        void GetCameraSettings()
        {
            Camera mainCam = mainCamera.GetComponent<Camera>();
            if(mainCam)
            {
                skyCamera.renderingPath = mainCam.renderingPath;
                skyCamera.fieldOfView = mainCam.fieldOfView;

            }
            else
            {
                Debug.Log("Using default settings for SkyCamera");
                skyCamera.fieldOfView = 65;
                skyCamera.renderingPath = RenderingPath.DeferredShading;

            }


{'fraction_non_alphanumeric': 0.08883994126284875, 'fraction_numerical': 0.0022026431718061676, 'mean_word_length': 1.978862973760933, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7221939', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1070, 'n_words': 204}