From 2be0d5c5ac651db7b8d52e785fc36748bb2f409a Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期二, 19 三月 2019 20:48:56 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/Realm/RealmModel.cs                   |   16 ++++++++++++++++
 System/Realm/RealmWin.cs                     |    9 ++++-----
 Core/MapEditor/Behavior/Bhv_Trasfer.cs       |   24 +++++++++++++++++++++++-
 Core/MapEditor/Behavior/Bhv_TransferPoint.cs |   11 +++++++++++
 4 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/Core/MapEditor/Behavior/Bhv_TransferPoint.cs b/Core/MapEditor/Behavior/Bhv_TransferPoint.cs
index 774f985..661f866 100644
--- a/Core/MapEditor/Behavior/Bhv_TransferPoint.cs
+++ b/Core/MapEditor/Behavior/Bhv_TransferPoint.cs
@@ -17,6 +17,8 @@
         [HideInInspector]
         public CapsuleCollider capsuleCollider;
 
+        public GameObject Effect;
+
         public void Save(BinaryWriter bw)
         {
             bw.Write(effectID);
@@ -43,6 +45,15 @@
             transform.position = new Vector3(_x, _y, _z);
             float _r = br.ReadSingle();
             capsuleCollider.radius = _r;
+            if (EffectConfig.Has(effectID))
+            {
+                var _prefab = InstanceResourcesLoader.LoadEffect(effectID);
+                Effect = Instantiate(_prefab);
+                Effect.transform.SetParent(transform);
+                Effect.transform.localPosition = Vector3.zero;
+                Effect.transform.localScale = Vector3.one;
+                Effect.transform.rotation = Quaternion.identity;
+            }
         }
 
         public void Export(BinaryWriter bw)
diff --git a/Core/MapEditor/Behavior/Bhv_Trasfer.cs b/Core/MapEditor/Behavior/Bhv_Trasfer.cs
index 3fc8d2b..ebb1233 100644
--- a/Core/MapEditor/Behavior/Bhv_Trasfer.cs
+++ b/Core/MapEditor/Behavior/Bhv_Trasfer.cs
@@ -120,7 +120,29 @@
                         EditorGUILayout.BeginHorizontal(GUILayout.Height(22));
                         EditorGUILayout.LabelField("[" + (i + 1) + "]", guiSkin.customStyles[0], GUILayout.Height(20), GUILayout.Width(25));
                         EditorGUILayout.LabelField("鐗规晥", guiSkin.customStyles[0], GUILayout.Height(20), GUILayout.Width(25));
-                        pointList[i].effectID = EditorGUILayout.IntField(pointList[i].effectID, guiSkin.textField, GUILayout.Height(20));
+                        var _effectID = pointList[i].effectID;
+                        _effectID = EditorGUILayout.IntField(_effectID, guiSkin.textField, GUILayout.Height(20));
+                        if (_effectID != pointList[i].effectID)
+                        {
+                            if (EffectConfig.Has(_effectID))
+                            {
+                                var _prefab = InstanceResourcesLoader.LoadEffect(_effectID);
+                                if (_prefab)
+                                {
+                                    if (pointList[i].Effect)
+                                    {
+                                        DestroyImmediate(pointList[i].Effect);
+                                        pointList[i].Effect = null;
+                                    }
+                                    pointList[i].Effect = Instantiate(_prefab);
+                                    pointList[i].Effect.transform.SetParent(pointList[i].transform);
+                                    pointList[i].Effect.transform.localPosition = Vector3.zero;
+                                    pointList[i].Effect.transform.localScale = Vector3.one;
+                                    pointList[i].Effect.transform.rotation = Quaternion.identity;
+                                    pointList[i].effectID = _effectID;
+                                }
+                            }
+                        }
                         EditorGUILayout.EndHorizontal();
 
                         if (i - 1 >= 0)
diff --git a/System/Realm/RealmModel.cs b/System/Realm/RealmModel.cs
index 72fb900..c8925c0 100644
--- a/System/Realm/RealmModel.cs
+++ b/System/Realm/RealmModel.cs
@@ -73,11 +73,15 @@
         public void OnBeforePlayerDataInitialize()
         {
             isBossPass = false;
+            SysNotifyMgr.Instance.OnSystemNotifyEvent -= OnSystemNotifyEvent;
         }
 
         public void OnPlayerLoginOk()
         {
             redpointDirty = true;
+
+            SysNotifyMgr.Instance.OnSystemNotifyEvent -= OnSystemNotifyEvent;
+            SysNotifyMgr.Instance.OnSystemNotifyEvent += OnSystemNotifyEvent;
         }
 
         public override void UnInit()
@@ -338,6 +342,18 @@
             }
         }
 
+        private void OnSystemNotifyEvent(string key)
+        {
+            if (key == "BigRealmUpSuccess")
+            {
+                if (WindowCenter.Instance.IsOpen<MainInterfaceWin>()
+                    && !WindowCenter.Instance.ExistAnyFullScreenOrMaskWin())
+                {
+                    EffectMgr.Instance.PlayUIEffect(7047, 1800, WindowCenter.Instance.uiRoot.baseCanvas, false);
+                }
+            }
+        }
+
         private void PlayerDataRefreshEvent(PlayerDataType dataType)
         {
             if (dataType == PlayerDataType.RealmLevel
diff --git a/System/Realm/RealmWin.cs b/System/Realm/RealmWin.cs
index 1da81d5..06e074b 100644
--- a/System/Realm/RealmWin.cs
+++ b/System/Realm/RealmWin.cs
@@ -176,17 +176,16 @@
 
             if (model.SatisfyChallengeBoss(model.displayRealmLevel))
             {
-                if (model.GetBossEffectShow(model.displayRealmLevel))
-                {
-                    DisplayEffectBoss();
-                }
-                else
+                if (!model.GetBossEffectShow(model.displayRealmLevel))
                 {
                     m_RealmAnimation.StartBossEffectShow();
                     m_GotoBoss.gameObject.SetActive(false);
                     model.SetBossEffectShow(model.displayRealmLevel);
+                    return;
                 }
             }
+            DisplayEffectBoss();
+
         }
 
         void HideRealmUp()

--
Gitblit v1.8.0