From 0eaa2428be82b5c2f683b4e22efa3d01d89acd2c Mon Sep 17 00:00:00 2001
From: client_Zxw <826696702@qq.com>
Date: 星期四, 28 三月 2019 17:16:27 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
System/Role/ReikiRootWin.cs | 12 ++++--
System/Strengthening/HowToPlayWin.cs | 4 +-
System/Role/ReikiRootRuleWin.cs.meta | 12 ++++++
System/Role/ReikiRootPointBehaviour.cs | 46 ++++++++++++++++------
System/Role/ReikiRootModel.cs | 21 ++++++++++
System/Role/ReikiRootRuleWin.cs | 23 +++++++++++
6 files changed, 99 insertions(+), 19 deletions(-)
diff --git a/System/Role/ReikiRootModel.cs b/System/Role/ReikiRootModel.cs
index 426db3e..55a1197 100644
--- a/System/Role/ReikiRootModel.cs
+++ b/System/Role/ReikiRootModel.cs
@@ -294,6 +294,27 @@
return value;
}
+ public static string GetQualityLabel(int quality)
+ {
+ switch (quality)
+ {
+ case 1:
+ return "銆愪笅鍝併��";
+ case 2:
+ return "銆愪腑鍝併��";
+ case 3:
+ return "銆愯壇鍝併��";
+ case 4:
+ return "銆愪笂鍝併��";
+ case 5:
+ return "銆愭瀬鍝併��";
+ case 6:
+ return "銆愬畬缇庛��";
+ default:
+ return "銆愪笅鍝併��";
+ }
+ }
+
public void ReceivePackage(HB107_tagMCRolePointInfo package)
{
for (int i = 0; i < package.PointAttrIDCount; i++)
diff --git a/System/Role/ReikiRootPointBehaviour.cs b/System/Role/ReikiRootPointBehaviour.cs
index d33924c..cb6b02c 100644
--- a/System/Role/ReikiRootPointBehaviour.cs
+++ b/System/Role/ReikiRootPointBehaviour.cs
@@ -8,7 +8,6 @@
public class ReikiRootPointBehaviour : MonoBehaviour
{
[SerializeField] Text m_PropertyName;
- [SerializeField] Text m_PropertyValue;
[SerializeField] Text m_Point;
[SerializeField] Button m_Add;
[SerializeField] Button m_Sub;
@@ -42,6 +41,8 @@
bool isPointAdd = false;
bool isPointSub = false;
+ int cacheQuality = 0;
+
int coroutineCount = 0;
static WaitForSeconds waitSpeedFaster = new WaitForSeconds(0.05f);
@@ -62,24 +63,36 @@
{
parent = win;
this.id = id;
- DisplayBase();
+
+ cacheQuality = 0;
+
DisplayPoint();
model.onReikiRootPointRefresh += OnReikiRootPointRefresh;
}
- void DisplayBase()
- {
- var propertyConfig = PlayerPropertyConfig.Get(id);
- m_PropertyName.text = propertyConfig.Name;
- var qualiaty = model.GetReikiRootQuality(id);
- m_PropertyName.color = UIHelper.GetUIColor(qualiaty, true);
- m_PropertyValue.text = UIHelper.GetPropertyMapPlayerData((PropertyType)id).ToString();
- }
-
void DisplayPoint()
{
- m_Point.text = point.ToString();
+ var original = model.GetReikiRootPoint(id);
+ var addLabel = point == 0 ? string.Empty : UIHelper.AppendColor(TextColType.Green, "+" + point, true);
+ var quality = model.GetReikiRootQuality(id, original + point);
+ var areaPoint = model.GetQualityPoint(id, quality + 1);
+ if (areaPoint == 0)
+ {
+ m_Point.text = StringUtility.Contact(original, addLabel);
+ }
+ else
+ {
+ m_Point.text = StringUtility.Contact(original, addLabel, "/", areaPoint);
+ }
+
+ if (cacheQuality != quality)
+ {
+ var propertyConfig = PlayerPropertyConfig.Get(id);
+ m_PropertyName.text = StringUtility.Contact(propertyConfig.Name, ReikiRootModel.GetQualityLabel(quality));
+ m_PropertyName.color = UIHelper.GetUIColor(quality, true);
+ cacheQuality = quality;
+ }
}
private void OnAddDown(GameObject go)
@@ -142,7 +155,14 @@
private void OnReikiRootPointRefresh()
{
- DisplayBase();
+ if (point == 0)
+ {
+ DisplayPoint();
+ }
+ else
+ {
+ point = 0;
+ }
}
private void OpenKeyboard()
diff --git a/System/Role/ReikiRootRuleWin.cs b/System/Role/ReikiRootRuleWin.cs
new file mode 100644
index 0000000..49cac25
--- /dev/null
+++ b/System/Role/ReikiRootRuleWin.cs
@@ -0,0 +1,23 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Thursday, March 28, 2019
+//--------------------------------------------------------
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI {
+
+ public class ReikiRootRuleWin : HowToPlayWin
+ {
+
+ }
+
+}
+
+
+
+
diff --git a/System/Role/ReikiRootRuleWin.cs.meta b/System/Role/ReikiRootRuleWin.cs.meta
new file mode 100644
index 0000000..4567bae
--- /dev/null
+++ b/System/Role/ReikiRootRuleWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 70cc833dda7ed2e40a98ba014ab16b95
+timeCreated: 1553762754
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/Role/ReikiRootWin.cs b/System/Role/ReikiRootWin.cs
index 9a22be3..4d88e58 100644
--- a/System/Role/ReikiRootWin.cs
+++ b/System/Role/ReikiRootWin.cs
@@ -21,6 +21,7 @@
[SerializeField] Text m_FreePoint;
[SerializeField] Button m_Recommend;
[SerializeField] Button m_Confirm;
+ [SerializeField] Button m_Rule;
Dictionary<int, int> currentPropertyDict = new Dictionary<int, int>();
Dictionary<int, int> upPropertyDict = new Dictionary<int, int>();
@@ -43,6 +44,7 @@
{
m_Recommend.AddListener(OnRecommend);
m_Confirm.AddListener(Confirm);
+ m_Rule.AddListener(OnRule);
m_NumKeyboard.onValueChange.AddListener(OnPointValChange);
m_NumKeyboard.onConfirm.AddListener((bool isOk) =>
@@ -227,6 +229,12 @@
}
}
+ private void OnRule()
+ {
+ ModelCenter.Instance.GetModel<HowToPlayModel>().ruleId = 44;
+ WindowCenter.Instance.Open<ReikiRootRuleWin>();
+ }
+
private void OnCacheFreePointRefresh()
{
DisplayFreePoint();
@@ -237,10 +245,6 @@
{
if (dataType == PlayerDataType.FreePoint)
{
- foreach (var reikiRootPoint in m_ReikiRootPoints)
- {
- reikiRootPoint.point = 0;
- }
if (model.cacheFreePoint == model.freePoint)
{
OnCacheFreePointRefresh();
diff --git a/System/Strengthening/HowToPlayWin.cs b/System/Strengthening/HowToPlayWin.cs
index 7d6fb88..d32951a 100644
--- a/System/Strengthening/HowToPlayWin.cs
+++ b/System/Strengthening/HowToPlayWin.cs
@@ -9,7 +9,7 @@
{
[SerializeField] Text m_Title;
[SerializeField] Text m_Description;
- [SerializeField] RectTransform desRect;
+ [SerializeField] ScrollRect m_Scroller;
[SerializeField] Button m_CloseBtn;
[SerializeField] Button m_SureBtn;
@@ -44,7 +44,7 @@
protected override void OnPreOpen()
{
- desRect.anchoredPosition3D = new Vector3(desRect.anchoredPosition3D.x,140,0);
+ m_Scroller.verticalNormalizedPosition = 1f;
var config = RuleConfig.Get(model.ruleId);
if (!string.IsNullOrEmpty(config.Title))
{
--
Gitblit v1.8.0