Commit 28cb43aa authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent ac18f70c
Pipeline #5224 failed with stage
in 17 minutes and 3 seconds
using System.IO;
using UnityEngine;
using UnityEngine.Video;
public class BackgroundLoader : MonoBehaviour
{
private void Awake()
{
var player = GetComponent<VideoPlayer>();
player.url = Path.Combine(Directory.GetCurrentDirectory(), player.url);
player.Play();
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 25bc0a946ac1a4e4d985361ed2266cd9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: -1100
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Assertions;
......@@ -26,10 +27,6 @@ public class Setting : WindowServant2D
setting = gameObject.GetComponentInChildren<LAZYsetting>();
_screen = UIHelper.getByName<UIPopupList>(gameObject, "screen_");
_screen.items = new[] { new Resolution { width = 1300, height = 700 } }.Concat(Screen.resolutions)
.Select(r => $"{r.width} x {r.height}")
.Distinct()
.ToList();
UIHelper.registEvent(gameObject, "exit_", onClickExit);
UIHelper.registEvent(gameObject, "screen_", resizeScreen);
......@@ -133,6 +130,23 @@ public class Setting : WindowServant2D
{
var target = $"{Screen.width} x {Screen.height}";
if (_screen.value != target) _screen.value = target;
_screen.items = (Screen.fullScreen ? Screen.resolutions : WindowResolutions())
.Select(r => $"{r.width} x {r.height}")
.Distinct()
.ToList();
}
private static IEnumerable<Resolution> WindowResolutions()
{
var resolutions = new List<Resolution>();
var max = Screen.resolutions.Last();
for (var height = 560; height <= max.height && height * 1300 / 700 <= max.width; height += 7 * 20)
{
resolutions.Add(new Resolution {width = height * 1300 / 700, height = height});
}
return resolutions;
}
private void onCP()
......@@ -234,7 +248,7 @@ public class Setting : WindowServant2D
UIHelper.RestoreWindow();
var mats = UIHelper.getByName<UIPopupList>(gameObject, "screen_").value
.Split(new[] { " x " }, StringSplitOptions.RemoveEmptyEntries);
.Split(new[] {" x "}, StringSplitOptions.RemoveEmptyEntries);
Assert.IsTrue(mats.Length == 2);
Screen.SetResolution(int.Parse(mats[0]), int.Parse(mats[1]),
UIHelper.getByName<UIToggle>(gameObject, "full_").value);
......@@ -247,9 +261,9 @@ public class Setting : WindowServant2D
public void saveWhenQuit()
{
Config.Set("vol_", ((int)(UIHelper.getByName<UISlider>(gameObject, "vol_").value * 1000)).ToString());
Config.Set("size_", ((int)(UIHelper.getByName<UISlider>(gameObject, "size_").value * 1000)).ToString());
Config.Set("vSize_", ((int)(UIHelper.getByName<UISlider>(gameObject, "vSize_").value * 1000)).ToString());
Config.Set("vol_", ((int) (UIHelper.getByName<UISlider>(gameObject, "vol_").value * 1000)).ToString());
Config.Set("size_", ((int) (UIHelper.getByName<UISlider>(gameObject, "size_").value * 1000)).ToString());
Config.Set("vSize_", ((int) (UIHelper.getByName<UISlider>(gameObject, "vSize_").value * 1000)).ToString());
//Config.Set("alpha_", ((int)(UIHelper.getByName<UISlider>(gameObject, "alpha_").value * 1000)).ToString());
Config.Set("longField_",
UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "longField_").value));
......
......@@ -1260,6 +1260,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 947056520}
- component: {fileID: 947056521}
- component: {fileID: 947056519}
m_Layer: 8
m_Name: Background
......@@ -1297,7 +1298,7 @@ VideoPlayer:
m_EnabledAudioTracks: 00
m_DirectAudioMutes: 00
m_ControlledAudioTrackCount: 1
m_PlayOnAwake: 1
m_PlayOnAwake: 0
m_SkipOnDrop: 1
m_Looping: 1
m_WaitForFirstFrame: 1
......@@ -1317,6 +1318,18 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &947056521
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 947056518}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 25bc0a946ac1a4e4d985361ed2266cd9, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &949649613
PrefabInstance:
m_ObjectHideFlags: 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment