From 3fddd64a7e9a1270bf892f7c5fd019c217c7c7c3 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期二, 06 十一月 2018 10:33:34 +0800
Subject: [PATCH] 4398 【1.2】聊天气泡框

---
 Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs.meta |    2 +-
 Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs      |    9 ++++++---
 System/Chat/ChatBubbleBehaviour.cs                       |   10 ++++++++++
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs b/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs
index 737da5c..5e9355d 100644
--- a/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs
+++ b/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs
@@ -1,6 +1,6 @@
 锘�//--------------------------------------------------------
 //    [Author]:			绗簩涓栫晫
-//    [  Date ]:		   Monday, November 05, 2018
+//    [  Date ]:		   Tuesday, November 06, 2018
 //--------------------------------------------------------
 
 using UnityEngine;
@@ -22,7 +22,8 @@
 		public string Icon { get ; private set; } 
 		public int Jump { get ; private set ; }
 		public string GainTip { get ; private set; } 
-		public int[] color;
+		public int[] color;
+		public int top { get ; private set ; }
 
 		public override string getKey()
         {
@@ -69,7 +70,9 @@
 				for (int i=0;i<colorStringArray.Length;i++)
 				{
 					 int.TryParse(colorStringArray[i],out color[i]);
-				}
+				}
+			
+				top=IsNumeric(rawContents[12]) ? int.Parse(rawContents[12]):0; 
             }
             catch (Exception ex)
             {
diff --git a/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs.meta b/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs.meta
index 025e2ea..90b45ea 100644
--- a/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs.meta
+++ b/Core/GameEngine/Model/Config/ChatBubbleBoxConfig.cs.meta
@@ -1,6 +1,6 @@
 fileFormatVersion: 2
 guid: d3368c32387593943aae6e197d7cb78f
-timeCreated: 1541411608
+timeCreated: 1541471355
 licenseType: Pro
 MonoImporter:
   serializedVersion: 2
diff --git a/System/Chat/ChatBubbleBehaviour.cs b/System/Chat/ChatBubbleBehaviour.cs
index 1d5f905..bb24d78 100644
--- a/System/Chat/ChatBubbleBehaviour.cs
+++ b/System/Chat/ChatBubbleBehaviour.cs
@@ -1,5 +1,6 @@
 锘縰sing System.Collections;
 using System.Collections.Generic;
+using TableConfig;
 using UnityEngine;
 using UnityEngine.UI;
 
@@ -99,6 +100,15 @@
                 m_BubbleIcon.SetSprite(iconKey);
                 m_Flip.flipHorizontal = requireFlip;
                 m_Target.color = bubble.color;
+
+                var config = Config.Instance.Get<ChatBubbleBoxConfig>(bubbleId);
+                var position = rect.anchoredPosition;
+                position.y = -config.top;
+                if (rect.anchoredPosition != position)
+                {
+                    rect.anchoredPosition = position;
+                }
+
                 Refresh();
             }
         }

--
Gitblit v1.8.0