Explorar o código

提交一波。。。

xyh1985 hai 1 ano
pai
achega
6f80d4a843

+ 0 - 178
Unity/Assets/Bundles/UI/UIHelp.prefab

@@ -1,178 +0,0 @@
-%YAML 1.1
-%TAG !u! tag:unity3d.com,2011:
---- !u!1 &1386170326414932
-GameObject:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  serializedVersion: 6
-  m_Component:
-  - component: {fileID: 224438795553994780}
-  - component: {fileID: 3539700472237229061}
-  - component: {fileID: 3539700472237229083}
-  - component: {fileID: 114850350457908736}
-  m_Layer: 5
-  m_Name: UIHelp
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!224 &224438795553994780
-RectTransform:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1386170326414932}
-  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children:
-  - {fileID: 2042953167946995736}
-  m_Father: {fileID: 0}
-  m_RootOrder: 0
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 1, y: 1}
-  m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 0, y: 0}
-  m_Pivot: {x: 0.5, y: 0.5}
---- !u!223 &3539700472237229061
-Canvas:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1386170326414932}
-  m_Enabled: 1
-  serializedVersion: 3
-  m_RenderMode: 1
-  m_Camera: {fileID: 0}
-  m_PlaneDistance: 100
-  m_PixelPerfect: 0
-  m_ReceivesEvents: 1
-  m_OverrideSorting: 0
-  m_OverridePixelPerfect: 0
-  m_SortingBucketNormalizedSize: 0
-  m_AdditionalShaderChannelsFlag: 0
-  m_SortingLayerID: 0
-  m_SortingOrder: 0
-  m_TargetDisplay: 0
---- !u!114 &3539700472237229083
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1386170326414932}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  m_IgnoreReversedGraphics: 1
-  m_BlockingObjects: 0
-  m_BlockingMask:
-    serializedVersion: 2
-    m_Bits: 4294967295
---- !u!114 &114850350457908736
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1386170326414932}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 502d8cafd6a5a0447ab1db9a24cdcb10, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  data: []
---- !u!1 &5924122422788570510
-GameObject:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  serializedVersion: 6
-  m_Component:
-  - component: {fileID: 2042953167946995736}
-  - component: {fileID: 7729256126041248981}
-  - component: {fileID: 476678119492089194}
-  m_Layer: 5
-  m_Name: Text
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!224 &2042953167946995736
-RectTransform:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 5924122422788570510}
-  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children: []
-  m_Father: {fileID: 224438795553994780}
-  m_RootOrder: 0
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 1}
-  m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 0.000061035156, y: 0}
-  m_SizeDelta: {x: 639.28406, y: 316.149}
-  m_Pivot: {x: 0, y: 1}
---- !u!222 &7729256126041248981
-CanvasRenderer:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 5924122422788570510}
-  m_CullTransparentMesh: 1
---- !u!114 &476678119492089194
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 5924122422788570510}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  m_Material: {fileID: 0}
-  m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
-  m_RaycastTarget: 1
-  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
-  m_Maskable: 1
-  m_OnCullStateChanged:
-    m_PersistentCalls:
-      m_Calls: []
-  m_FontData:
-    m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
-    m_FontSize: 64
-    m_FontStyle: 0
-    m_BestFit: 0
-    m_MinSize: 2
-    m_MaxSize: 64
-    m_Alignment: 0
-    m_AlignByGeometry: 0
-    m_RichText: 1
-    m_HorizontalOverflow: 0
-    m_VerticalOverflow: 1
-    m_LineSpacing: 1
-  m_Text: 'Help:
-
-    1. Mouse Right Move
-
-    2. R Reload Dll
-
-    3. T Transfer
-    Map'

+ 0 - 7
Unity/Assets/Bundles/UI/UIHelp.prefab.meta

@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: c54e8d9624286b24fa23519e5df2ed0a
-PrefabImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: uihelp.unity3d
-  assetBundleVariant: 

+ 1 - 1
Unity/Assets/Res/UI/Altas/SetingAtlas/btn_checkbox.png.meta

@@ -143,5 +143,5 @@ TextureImporter:
   pSDRemoveMatte: 0
   pSDShowRemoveMatteOption: 0
   userData: 
-  assetBundleName: 
+  assetBundleName: setingatlas.unity3d
   assetBundleVariant: 

+ 1 - 1
Unity/Assets/Res/UI/Altas/SetingAtlas/check_mark.png.meta

@@ -143,5 +143,5 @@ TextureImporter:
   pSDRemoveMatte: 0
   pSDShowRemoveMatteOption: 0
   userData: 
-  assetBundleName: 
+  assetBundleName: setingatlas.unity3d
   assetBundleVariant: 

+ 1 - 1
Unity/Assets/Res/UI/Altas/SetingAtlas/setting_bar.png.meta

@@ -143,5 +143,5 @@ TextureImporter:
   pSDRemoveMatte: 0
   pSDShowRemoveMatteOption: 0
   userData: 
-  assetBundleName: 
+  assetBundleName: setingatlas.unity3d
   assetBundleVariant: 

+ 1 - 1
Unity/Assets/Res/UI/Altas/SetingAtlas/setting_bar_bg.png.meta

@@ -143,5 +143,5 @@ TextureImporter:
   pSDRemoveMatte: 0
   pSDShowRemoveMatteOption: 0
   userData: 
-  assetBundleName: 
+  assetBundleName: setingatlas.unity3d
   assetBundleVariant: 

+ 1 - 1
Unity/Assets/Res/UI/Altas/SetingAtlas/setting_max_sound_sign.png.meta

@@ -143,5 +143,5 @@ TextureImporter:
   pSDRemoveMatte: 0
   pSDShowRemoveMatteOption: 0
   userData: 
-  assetBundleName: 
+  assetBundleName: setingatlas.unity3d
   assetBundleVariant: 

+ 1 - 1
Unity/Assets/Res/UI/Altas/SetingAtlas/setting_min_sound_sign.png.meta

@@ -143,5 +143,5 @@ TextureImporter:
   pSDRemoveMatte: 0
   pSDShowRemoveMatteOption: 0
   userData: 
-  assetBundleName: 
+  assetBundleName: setingatlas.unity3d
   assetBundleVariant: 

+ 1 - 1
Unity/Assets/Res/UI/Altas/SetingAtlas/setting_music.png.meta

@@ -143,5 +143,5 @@ TextureImporter:
   pSDRemoveMatte: 0
   pSDShowRemoveMatteOption: 0
   userData: 
-  assetBundleName: 
+  assetBundleName: setingatlas.unity3d
   assetBundleVariant: 

+ 1 - 1
Unity/Assets/Res/UI/Altas/SetingAtlas/setting_segment.png.meta

@@ -143,5 +143,5 @@ TextureImporter:
   pSDRemoveMatte: 0
   pSDShowRemoveMatteOption: 0
   userData: 
-  assetBundleName: 
+  assetBundleName: setingatlas.unity3d
   assetBundleVariant: 

+ 1 - 1
Unity/Assets/Res/UI/Altas/SetingAtlas/setting_sound_effect.png.meta

@@ -143,5 +143,5 @@ TextureImporter:
   pSDRemoveMatte: 0
   pSDShowRemoveMatteOption: 0
   userData: 
-  assetBundleName: 
+  assetBundleName: setingatlas.unity3d
   assetBundleVariant: 

+ 1 - 1
Unity/Assets/Scripts/Codes/Hotfix/Client/StartFight/StartFightRoomComponentSystem.cs

@@ -18,7 +18,7 @@ namespace ET
 
         public static void SetStartFightRoomInfo(this StartFightRoomComponment self, G2C_JoinRoom g2JoinRoom)
         {
-            self.startFightRoomInfo.roomInfo = g2JoinRoom.Info;
+            //self.startFightRoomInfo.roomInfo = g2JoinRoom.Info;
         }
 
         public static StartFightRoomInfo GetStartFightRoomInfo(this StartFightRoomComponment self)

+ 41 - 12
Unity/Assets/Scripts/Codes/HotfixView/Client/Demo/UI/UISetting/UISettingComponentSystem.cs

@@ -36,6 +36,7 @@ namespace ET.Client
 
         private static void Init(this UISettingComponent self)
         {
+            
         }
 
         public static void OnVerCheckBtn(this UISettingComponent self)
@@ -48,18 +49,26 @@ namespace ET.Client
 
         }
 
-        public static void OnGameoBgVedioBtn(this UISettingComponent self)
+        public static async void OnGameoBgVedioBtn(this UISettingComponent self)
         {
             self.isGameBgVedio = !self.isGameBgVedio;
             string abName = self.isGameBgVedio ? "setting_max_sound_sign" : "setting_min_sound_sign";
-            var obj = ResourcesComponent.Instance.GetAsset(abName, "SetingAtlas");
-            Debug.Log("");
-            //self.gameoBgVedioBtn.GetComponent<UnityEngine.UI.Image>().sprite = abName;
+            await ResourcesComponentHelper.Instance.LoadSprite(self.ClientScene(),"setingatlas");
+            Sprite sprite = ResourcesComponentHelper.Instance.GetSprite("setingatlas",abName);
+            self.gameoBgVedioBtn.GetComponent<UnityEngine.UI.Image>().sprite = sprite;
+            MusicSoundComponent.Instance.MusicMuteSwitch(!self.isGameBgVedio);
+            self.gameoBgVedioSlider.GetComponent<Slider>().value = self.isGameBgVedio? PlayerPrefs.GetFloat(MusicSoundComponent.MusicVolumeBgPrefsName) : 0;
         }
 
-        public static void OnGameoInVedioBtn(this UISettingComponent self)
+        public static async void OnGameoInVedioBtn(this UISettingComponent self)
         {
-
+            self.isGameInVedio = !self.isGameInVedio;
+            string abName = self.isGameInVedio ? "setting_max_sound_sign" : "setting_min_sound_sign";
+            await ResourcesComponentHelper.Instance.LoadSprite(self.ClientScene(), "setingatlas");
+            Sprite sprite = ResourcesComponentHelper.Instance.GetSprite("setingatlas", abName);
+            self.gameoInVedioBtn.GetComponent<UnityEngine.UI.Image>().sprite = sprite;
+            MusicSoundComponent.Instance.SoundMuteSwitch(!self.isGameInVedio);
+            self.gameoInVedioSlider.GetComponent<Slider>().value = self.isGameInVedio ? PlayerPrefs.GetFloat(MusicSoundComponent.SoundVolumePrefsName) : 0;
         }
 
         public static void OnCloseBtn(this UISettingComponent self)
@@ -67,14 +76,34 @@ namespace ET.Client
             self.OnCloseAsync();
         }
 
-        public static void OnGameoBgVedioSlider(this UISettingComponent self,float val)
-        { 
-        
+        public static async void OnGameoBgVedioSlider(this UISettingComponent self,float val)
+        {
+            if (val <= 0)
+            {
+                return;
+            }
+            self.isGameBgVedio = true;
+            string abName = self.isGameBgVedio ? "setting_max_sound_sign" : "setting_min_sound_sign";
+            await ResourcesComponentHelper.Instance.LoadSprite(self.ClientScene(), "setingatlas");
+            Sprite sprite = ResourcesComponentHelper.Instance.GetSprite("setingatlas", abName);
+            self.gameoBgVedioBtn.GetComponent<UnityEngine.UI.Image>().sprite = sprite;
+            MusicSoundComponent.Instance.MusicMuteSwitch(!self.isGameBgVedio);
+            MusicSoundComponent.Instance.MusicBgVolume = val;
         }
 
-        public static void OnGameoInVedioSlider(this UISettingComponent self, float val)
-        { 
-            
+        public static async void OnGameoInVedioSlider(this UISettingComponent self, float val)
+        {
+            if (val <= 0)
+            {
+                return;
+            }
+            self.isGameInVedio = true;
+            string abName = self.isGameInVedio ? "setting_max_sound_sign" : "setting_min_sound_sign";
+            await ResourcesComponentHelper.Instance.LoadSprite(self.ClientScene(), "setingatlas");
+            Sprite sprite = ResourcesComponentHelper.Instance.GetSprite("setingatlas", abName);
+            self.gameoInVedioBtn.GetComponent<UnityEngine.UI.Image>().sprite = sprite;
+            MusicSoundComponent.Instance.SoundMuteSwitch(!self.isGameInVedio);
+            MusicSoundComponent.Instance.SoundVolume = val;
         }
 
         public static async void OnCloseAsync(this UISettingComponent self)

+ 58 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Module/Resource/ResourcesComponentHelper.cs

@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using UnityEngine;
+
+namespace ET.Client
+{
+    [FriendOf(typeof(ResourcesComponentHelper))]
+    public static class ResourcesComponentHelperSystem
+    {
+        [ObjectSystem]
+        public class ResourcesComponentHelperAwakeSystem : AwakeSystem<ResourcesComponentHelper>
+        {
+            protected override void Awake(ResourcesComponentHelper self)
+            {
+                ResourcesComponentHelper.Instance = self;
+            }
+        }
+        
+        [ObjectSystem]
+        public class ResourcesComponentHelperDestroySystem : DestroySystem<ResourcesComponentHelper>
+        {
+            protected override void Destroy(ResourcesComponentHelper self)
+            {
+                ResourcesComponentHelper.Instance = null;
+
+                
+            }
+        }
+
+        public static async ETTask LoadSprite(this ResourcesComponentHelper self,Scene scene,string ab)
+        {
+            await scene.GetComponent<ResourcesLoaderComponent>().LoadAsync(ab.StringToAB());
+        }
+
+        public static Sprite GetSprite(this ResourcesComponentHelper self,string ab, string spriteName)
+        {
+            UnityEngine.Object spriteObj = ResourcesComponent.Instance.GetAsset(ab.StringToAB(), spriteName);
+            if (spriteObj != null)
+            {
+                Texture2D texture = spriteObj as Texture2D;
+                var sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f), 100f);
+                return sprite;
+            }
+            return null;
+        }
+    }
+
+    [ComponentOf(typeof(Scene))]
+    public class ResourcesComponentHelper : Entity, IAwake, IDestroy
+    {
+        public static ResourcesComponentHelper Instance { get; set; }
+
+        
+    }
+}

+ 11 - 0
Unity/Assets/Scripts/Codes/ModelView/Client/Module/Resource/ResourcesComponentHelper.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5b8368276dfd93f458bb57b041628c57
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 3
Unity/Assets/Scripts/Core/Module/MusicSound/MusicSoundComponent.cs

@@ -7,7 +7,7 @@ namespace ET
     {
         private AudioSource mMusicBgAudioSource;
         private AudioSource mSoundAudioSource;
-        public const string MusicVolumePrefsName = "PlayerPrefs_MusicVolume";
+        public const string MusicVolumeBgPrefsName = "PlayerPrefs_MusicVolume";
         public const string SoundVolumePrefsName = "PlayerPrefs_SoundVolume";
         public void Init()
         {
@@ -15,7 +15,7 @@ namespace ET
             mSoundAudioSource = GameObject.Find("Global").AddComponent<AudioSource>();
             mMusicBgAudioSource.loop = true;
             mSoundAudioSource.loop = false;
-            MusicBgVolume = PlayerPrefs.GetFloat(MusicVolumePrefsName, 1f);
+            MusicBgVolume = PlayerPrefs.GetFloat(MusicVolumeBgPrefsName, 1f);
             SoundVolume=PlayerPrefs.GetFloat(SoundVolumePrefsName, 1f);
             
         }
@@ -60,7 +60,7 @@ namespace ET
             get { return mMusicBgAudioSource.volume; }
             set
             {
-                PlayerPrefs.SetFloat(MusicVolumePrefsName, value);
+                PlayerPrefs.SetFloat(MusicVolumeBgPrefsName, value);
                 mMusicBgAudioSource.volume = value;
             }
         }