From 8f1e97b70bec3d418ef04dd426f4c5944aa8d4a9 Mon Sep 17 00:00:00 2001 From: YangHua <1475658476@qq.com> Date: Fri, 24 Nov 2023 17:32:39 +0800 Subject: [PATCH] 23 --- Assets/GameAssets/Materials/主席台/DX.mat | 16 +++++-------- .../Adam/Utility/Sync/ContectServer.cs | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/Assets/GameAssets/Materials/主席台/DX.mat b/Assets/GameAssets/Materials/主席台/DX.mat index c3b3e8f7..b5e58aaf 100644 --- a/Assets/GameAssets/Materials/主席台/DX.mat +++ b/Assets/GameAssets/Materials/主席台/DX.mat @@ -2,17 +2,15 @@ %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: - serializedVersion: 8 + serializedVersion: 6 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: DX m_Shader: {fileID: 47, guid: 0000000000000000f000000000000000, type: 0} - m_ValidKeywords: - - _EMISSION - m_InvalidKeywords: [] - m_LightmapFlags: 1 + m_ShaderKeywords: _SPECULARHIGHLIGHTS_OFF + m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 @@ -61,25 +59,23 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - m_Ints: [] m_Floats: - _BumpScale: 1 - _Cutoff: 0.5 - _DetailNormalMapScale: 1 - _DstBlend: 0 - _GlossMapScale: 1 - - _Glossiness: 0.5 + - _Glossiness: 0 - _GlossyReflections: 1 - _Metallic: 0 - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 + - _SpecularHighlights: 0 - _SrcBlend: 1 - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 0.5566038, g: 0.5566038, b: 0.5566038, a: 1} + - _Color: {r: 0.6037736, g: 0.6037736, b: 0.6037736, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/Zion/Scripts/Adam/Utility/Sync/ContectServer.cs b/Assets/Zion/Scripts/Adam/Utility/Sync/ContectServer.cs index 3095e700..b6ade421 100644 --- a/Assets/Zion/Scripts/Adam/Utility/Sync/ContectServer.cs +++ b/Assets/Zion/Scripts/Adam/Utility/Sync/ContectServer.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using System.IO; using UnityEngine; using UnityEngine.SceneManagement; namespace AdamSync @@ -12,6 +13,7 @@ namespace AdamSync // Start is called before the first frame update private async void Awake() { + serverIP = ReadFromLocal("confing.txt"); Debug.Log("Net"); DontDestroyOnLoad(gameObject); SceneManager.LoadScene("SampleScene"); @@ -30,6 +32,28 @@ namespace AdamSync //} } + public static string ReadFromLocal(string fileName) + { + string path = GetPath(fileName); + if (!File.Exists(path)) return "无"; + string data = File.ReadAllText(path); + return data; + } + + public static string[] ReadAllFromLocal(string fileName) + { + string path = GetPath(fileName); + if (!File.Exists(path)) return null; + string[] data = File.ReadAllLines(path); + return data; + } + + public static string GetPath(string fileName) + { + string path = Application.streamingAssetsPath + "/" + fileName; + return path; + } + private void OnDisable() { SyncCreateRoom.CloseClint();