postprocessing options (1)
This commit is contained in:
Executable file → Normal file
Executable file → Normal file
Executable file → Normal file
Executable file → Normal file
Executable file → Normal file
Executable file → Normal file
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Executable file → Normal file
Executable file → Normal file
Executable file → Normal file
Executable file → Normal file
Executable file → Normal file
+29
-14
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class HomeWorld_Initialize : MonoBehaviour
|
||||
@@ -28,6 +28,9 @@ public class HomeWorld_Initialize : MonoBehaviour
|
||||
public RectTransform SettingsPanel;
|
||||
private Resolution GameResolutionPre;
|
||||
public Toggle FullscreenToggle;
|
||||
public Toggle PostProcessingToggle;
|
||||
public SettingsPanel SettingsPanelScript;
|
||||
|
||||
|
||||
private async void Start()
|
||||
{
|
||||
@@ -42,19 +45,19 @@ public class HomeWorld_Initialize : MonoBehaviour
|
||||
OpenMenuClip1 = await JTN.Utils.LoadClip(Path.Combine(Application.streamingAssetsPath, StartingClipName));
|
||||
if (audioSource && OpenMenuClip1)
|
||||
audioSource.PlayOneShot(OpenMenuClip1, PlayVolume);
|
||||
/* if (SettingsPanel)
|
||||
{
|
||||
if (Screen.currentResolution.height != GameResolutionPre.height)
|
||||
{
|
||||
SettingsPanel.sizeDelta = new Vector2(SettingsPanel.sizeDelta.x, Screen.currentResolution.height);
|
||||
GameResolutionPre = Screen.currentResolution;
|
||||
}
|
||||
if (Screen.currentResolution.width != GameResolutionPre.width)
|
||||
{
|
||||
SettingsPanel.sizeDelta = new Vector2(Screen.currentResolution.width, SettingsPanel.sizeDelta.y);
|
||||
GameResolutionPre = Screen.currentResolution;
|
||||
}
|
||||
}*/
|
||||
/* if (SettingsPanel)
|
||||
{
|
||||
if (Screen.currentResolution.height != GameResolutionPre.height)
|
||||
{
|
||||
SettingsPanel.sizeDelta = new Vector2(SettingsPanel.sizeDelta.x, Screen.currentResolution.height);
|
||||
GameResolutionPre = Screen.currentResolution;
|
||||
}
|
||||
if (Screen.currentResolution.width != GameResolutionPre.width)
|
||||
{
|
||||
SettingsPanel.sizeDelta = new Vector2(Screen.currentResolution.width, SettingsPanel.sizeDelta.y);
|
||||
GameResolutionPre = Screen.currentResolution;
|
||||
}
|
||||
}*/
|
||||
|
||||
if (PlayerPrefs.HasKey("FullscreenState") && FullscreenToggle)
|
||||
{
|
||||
@@ -66,6 +69,18 @@ public class HomeWorld_Initialize : MonoBehaviour
|
||||
FullscreenToggle.isOn = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (PlayerPrefs.GetInt("PostProcessingEnabled") == 1)
|
||||
{
|
||||
foreach (PostProcessVolume volume in SettingsPanelScript.PostProcessingVolumes)
|
||||
volume.enabled = true;
|
||||
PostProcessingToggle.isOn = true;
|
||||
} else
|
||||
{
|
||||
foreach (PostProcessVolume volume in SettingsPanelScript.PostProcessingVolumes)
|
||||
volume.enabled = false;
|
||||
PostProcessingToggle.isOn = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
|
||||
Executable file → Normal file
+15
-5
@@ -9,6 +9,8 @@ public class TimeController : MonoBehaviour
|
||||
{
|
||||
public TMP_Text TODIndicator;
|
||||
public Slider TODSlider;
|
||||
public bool UseLocalTime = false;
|
||||
|
||||
[HideInInspector]
|
||||
public GameObject sun;
|
||||
[HideInInspector]
|
||||
@@ -46,15 +48,23 @@ public class TimeController : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
SunUpdate();
|
||||
if (UseLocalTime)
|
||||
{
|
||||
timeOfDay = DateTime.Now.Hour + (DateTime.Now.Minute * 0.01f);
|
||||
SunUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
SunUpdate();
|
||||
timeOfDay += (Time.deltaTime / secondsPerDay) * timeMultiplier;
|
||||
|
||||
if (timeOfDay >= 24)
|
||||
timeOfDay = 0;
|
||||
}
|
||||
|
||||
timeOfDay += (Time.deltaTime / secondsPerDay) * timeMultiplier;
|
||||
StringTimeOfDay = FormatTime(timeOfDay, MilitaryTime);
|
||||
PublicFormattedTimeOfDay = StringTimeOfDay;
|
||||
|
||||
if (timeOfDay >= 24)
|
||||
timeOfDay = 0;
|
||||
|
||||
|
||||
if (TODIndicator)
|
||||
TODIndicator.text = StringTimeOfDay;
|
||||
|
||||
Executable file → Normal file
Executable file → Normal file
Executable file → Normal file
+12
-1
@@ -1,7 +1,6 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
|
||||
public class SettingsPanel : MonoBehaviour
|
||||
@@ -11,6 +10,8 @@ public class SettingsPanel : MonoBehaviour
|
||||
public bool DisableSettingsPanelWhenLinkedGameobjectIsActivated = false;
|
||||
public TMP_Dropdown GraphicsQualityDropdown;
|
||||
public PostProcessVolume PostProcessVolume;
|
||||
public List<PostProcessVolume> PostProcessingVolumes = new() { };
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (settingsPanel && DisableSettingsPanelWhenLinkedGameobjectIsActivated && settingsPanelDeactivator.activeInHierarchy)
|
||||
@@ -20,6 +21,16 @@ public class SettingsPanel : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void AcTogglePostProcessing(bool IsEnabled) {
|
||||
if (IsEnabled)
|
||||
PlayerPrefs.SetInt("PostProcessingEnabled", 1);
|
||||
else
|
||||
PlayerPrefs.SetInt("PostProcessingEnabled", 0);
|
||||
|
||||
foreach (PostProcessVolume volume in PostProcessingVolumes)
|
||||
volume.enabled = IsEnabled;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (GraphicsQualityDropdown)
|
||||
|
||||
Executable file → Normal file
Executable file → Normal file
+2
@@ -47,6 +47,8 @@ namespace JTN
|
||||
if (useStartupScriptHere)
|
||||
{
|
||||
resoChange();
|
||||
if (!PlayerPrefs.HasKey("PostProcessingEnabled"))
|
||||
PlayerPrefs.SetInt("PostProcessingEnabled", 1);
|
||||
foreach (string Filename in FilesThatMustExistInStreamingAssetsToSwitchScenes)
|
||||
if (!File.Exists(Path.Combine(Application.streamingAssetsPath, Filename)))
|
||||
{
|
||||
|
||||
Executable file → Normal file
Reference in New Issue
Block a user