From 61b188e1d59af9a1e3b4f005bd4b9211b2db97d8 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 09 十月 2025 15:46:31 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/System/NewBieGuidance/NewBieWin.cs.meta | 12
Main/System/NewBieGuidance/GuideCircleHollowImage.cs | 25 +
Main/System/NewBieGuidance/NewBieMask.cs | 24
Main/Component/UI/Effect/UIEffectPlayer.cs | 2
Main/System/NewBieGuidance.meta | 8
Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA710_tagMCGuideState.cs | 8
Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs | 63 ++
Main/Utility/UIUtility.cs | 36
Main/Config/PartialConfigs/GuideConfig.cs.meta | 11
Main/Component/UI/Effect/ImageMask.cs | 51 ++
Main/System/Main/HomeWin.cs | 6
Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs.meta | 12
Main/Main.cs | 1
Main/Component/UI/Effect/PostEffectsBaseEx.cs.meta | 11
Main/Component/UI/Effect/EffectPlayer.cs | 6
Main/Component/UI/Effect/PostEffectsBaseEx.cs | 52 ++
Main/Utility/EnumHelper.cs | 51 --
Main/System/Task/TaskManager.cs | 16
Main/Manager/UIManager.cs | 14
Main/Config/PartialConfigs/GuideConfig.cs | 51 ++
Main/Config/Configs/GuideConfig.cs | 39 -
Main/System/NewBieGuidance/GuideCircleHollowImage.cs.meta | 11
Main/System/NewBieGuidance/NewBieCenter.cs.meta | 12
Main/Component/UI/Decorate/Graph/CircleHollowImage.cs | 14
Main/Core/ResModule/ScriptableObjectLoader.cs.meta | 12
Main/System/NewBieGuidance/NewBieCenter.cs | 414 ++++++++++++++++
Main/Component/UI/Effect/ImageMask.cs.meta | 11
Main/System/NewBieGuidance/NewBieMask.cs.meta | 12
Main/System/NewBieGuidance/NewBieWin.cs | 324 ++++++++++++
Main/Component/UI/Common/ClickScreenOtherSpace.cs | 108 ++-
Main/Core/ResModule/ScriptableObjectLoader.cs | 48 +
31 files changed, 1,295 insertions(+), 170 deletions(-)
diff --git a/Main/Component/UI/Common/ClickScreenOtherSpace.cs b/Main/Component/UI/Common/ClickScreenOtherSpace.cs
index d9e96d1..a0a701a 100644
--- a/Main/Component/UI/Common/ClickScreenOtherSpace.cs
+++ b/Main/Component/UI/Common/ClickScreenOtherSpace.cs
@@ -5,59 +5,71 @@
using System;
using UnityEngine.Events;
- [RequireComponent(typeof(RectTransform))]
- public class ClickScreenOtherSpace : MonoBehaviour
+[RequireComponent(typeof(RectTransform))]
+public class ClickScreenOtherSpace : MonoBehaviour
+{
+ [SerializeField]
+ bool m_DeActiveSelf = true;
+ public bool deActiveSelf {
+ get { return m_DeActiveSelf; }
+ set { m_DeActiveSelf = value; }
+ }
+
+ [SerializeField]
+ RespondType m_RespondType = RespondType.Out;
+ public RespondType respondType {
+ get { return m_RespondType; }
+ set { m_RespondType = value; }
+ }
+
+ Action m_ClickOtherEvent;
+
+ public void AddListener(Action _callBack)
{
- [SerializeField]
- bool m_DeActiveSelf = true;
- public bool deActiveSelf {
- get { return m_DeActiveSelf; }
- set { m_DeActiveSelf = value; }
- }
+ m_ClickOtherEvent = null;
+ m_ClickOtherEvent += _callBack;
+ }
- [SerializeField]
- RespondType m_RespondType = RespondType.Out;
- public RespondType respondType {
- get { return m_RespondType; }
- set { m_RespondType = value; }
- }
+ public void RemoveAllListeners()
+ {
+ m_ClickOtherEvent = null;
+ }
- Action m_ClickOtherEvent;
- public void AddListener(Action _callBack)
+ private void LateUpdate()
+ {
+ if (Input.GetMouseButtonDown(0))
{
- m_ClickOtherEvent += _callBack;
- }
-
- public void RemoveAllListeners()
- {
- m_ClickOtherEvent = null;
- }
-
- private void LateUpdate()
- {
- if (Input.GetMouseButtonDown(0)) {
- var sp = Input.mousePosition;
- switch (m_RespondType) {
- case RespondType.In:
- if (RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera)) {
- m_ClickOtherEvent?.Invoke();
- this.SetActive(!m_DeActiveSelf);
- }
- break;
- case RespondType.Out:
- if (!RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera)) {
- m_ClickOtherEvent?.Invoke();
- this.SetActive(!m_DeActiveSelf);
- }
- break;
- }
+ var sp = Input.mousePosition;
+ switch (m_RespondType)
+ {
+ case RespondType.In:
+ if (RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera))
+ {
+ m_ClickOtherEvent?.Invoke();
+ this.SetActive(!m_DeActiveSelf);
+ }
+ break;
+ case RespondType.Out:
+ if (!RectTransformUtility.RectangleContainsScreenPoint(this.transform as RectTransform, sp, CameraManager.uiCamera))
+ {
+ m_ClickOtherEvent?.Invoke();
+ this.SetActive(!m_DeActiveSelf);
+ }
+ break;
+ case RespondType.InOut:
+ m_ClickOtherEvent?.Invoke();
+ this.SetActive(!m_DeActiveSelf);
+ break;
}
}
+ }
- public enum RespondType
- {
- In,
- Out,
- }
- }
\ No newline at end of file
+ public enum RespondType
+ {
+ In,
+ Out,
+ InOut
+
+ }
+}
\ No newline at end of file
diff --git a/Main/Component/UI/Decorate/Graph/CircleHollowImage.cs b/Main/Component/UI/Decorate/Graph/CircleHollowImage.cs
index d8174f3..f2e1b7f 100644
--- a/Main/Component/UI/Decorate/Graph/CircleHollowImage.cs
+++ b/Main/Component/UI/Decorate/Graph/CircleHollowImage.cs
@@ -22,7 +22,7 @@
[SerializeField]
Vector2 m_HollowArea=new Vector2(50,50);
- public Vector2 hollowArea {
+ public Vector2 cell {
get { return m_HollowArea; }
set {
m_HollowArea = value;
@@ -40,8 +40,8 @@
private Image m_Image;
public Image image { get { return m_Image ?? (m_Image = this.AddMissingComponent<Image>()); } }
- private List<Vector3> innerVertices;
- private List<Vector3> outterVertices;
+ protected List<Vector3> innerVertices;
+ protected List<Vector3> outterVertices;
protected override void Awake() {
innerVertices = new List<Vector3>();
@@ -60,8 +60,8 @@
var height = image.rectTransform.rect.height;
var outerArea = new Vector2(0.5f * width,0.5f * height);
- var realCenter = new Vector2(Mathf.Clamp(center.x,-width * 0.5f + hollowArea.x,width * 0.5f - hollowArea.x),
- Mathf.Clamp(center.y,-height * 0.5f + hollowArea.y,height * 0.5f - hollowArea.y));
+ var realCenter = new Vector2(Mathf.Clamp(center.x,-width * 0.5f + cell.x,width * 0.5f - cell.x),
+ Mathf.Clamp(center.y,-height * 0.5f + cell.y,height * 0.5f - cell.y));
var uv = image.overrideSprite != null ? DataUtility.GetOuterUV(image.overrideSprite) : Vector4.zero;
@@ -84,7 +84,7 @@
var sinA = Mathf.Sin(degree);
degree = degree - degreeDelta;
- position = new Vector3(realCenter.x + cosA * hollowArea.x,realCenter.y + sinA * hollowArea.y);
+ position = new Vector3(realCenter.x + cosA * cell.x,realCenter.y + sinA * cell.y);
uv0 = new Vector2(position.x * uvScaleX + uvCenterX,position.y * uvScaleY + uvCenterY);
uiVertex = UIUtility.PackageUIVertex(position,uv0,image.color);
vh.AddVert(uiVertex);
@@ -118,7 +118,7 @@
return Contains(local,outterVertices,innerVertices);
}
- private bool Contains(Vector2 p,List<Vector3> outterVertices,List<Vector3> innerVertices) {
+ protected bool Contains(Vector2 p,List<Vector3> outterVertices,List<Vector3> innerVertices) {
var crossNumber = 0;
crossNumber += UIUtility.RayCrossingCount(p,innerVertices);
crossNumber += UIUtility.RayCrossingCount(p,outterVertices);
diff --git a/Main/Component/UI/Effect/EffectPlayer.cs b/Main/Component/UI/Effect/EffectPlayer.cs
index a064afd..8af5bbd 100644
--- a/Main/Component/UI/Effect/EffectPlayer.cs
+++ b/Main/Component/UI/Effect/EffectPlayer.cs
@@ -61,7 +61,11 @@
protected EffectPenetrationBlocker blocker = null;
protected bool isInit = false;
- protected bool isPlaying = false;
+ public bool isPlaying
+ {
+ get;
+ protected set;
+ }
protected List<ParticleSystem> particleList = new List<ParticleSystem>();
diff --git a/Main/Component/UI/Effect/ImageMask.cs b/Main/Component/UI/Effect/ImageMask.cs
new file mode 100644
index 0000000..763ae23
--- /dev/null
+++ b/Main/Component/UI/Effect/ImageMask.cs
@@ -0,0 +1,51 @@
+using UnityEngine;
+
+[ExecuteAlways]
+public class ImageMask : PostEffectsBaseEx
+{
+ static readonly string shaderName = "lcl/screenEffect/MaskEffect";
+
+ // 閬僵澶у皬
+ [Range(0.01f, 10f), Tooltip("閬僵澶у皬")]
+ public float size = 5.0f;
+ // 杈圭紭妯$硦绋嬪害
+ [Range(0.0001f, 0.1f), Tooltip("杈圭紭妯$硦绋嬪害")]
+ public float edgeBlurLength = 0.05f;
+ // 閬僵涓績浣嶇疆
+ private Vector2 pos = new Vector4(0.5f, 0.5f);
+
+ void OnEnable()
+ {
+ shader = Shader.Find(shaderName);
+ }
+
+ // 娓叉煋灞忓箷
+ void OnRenderImage(RenderTexture source, RenderTexture destination)
+ {
+ if (material)
+ {
+ // 鎶婇紶鏍囧潗鏍囦紶閫掔粰shader
+ material.SetVector("_Pos", pos);
+ // 閬僵澶у皬
+ material.SetFloat("_Size", size);
+ // 妯$硦绋嬪害
+ material.SetFloat("_EdgeBlurLength", edgeBlurLength);
+ // 娓叉煋
+ Graphics.Blit(source, destination, material);
+ }
+ else
+ {
+ Graphics.Blit(source, destination);
+ }
+ }
+
+ // void Update()
+ // {
+ // if (Input.GetMouseButton(0))
+ // {
+ // Vector2 mousePos = Input.mousePosition;
+ // //灏唌ousePos杞寲涓猴紙0锛�1锛夊尯闂�
+ // pos = new Vector2(mousePos.x / Screen.width, mousePos.y / Screen.height);
+ // }
+ // }
+}
\ No newline at end of file
diff --git a/Main/Component/UI/Effect/ImageMask.cs.meta b/Main/Component/UI/Effect/ImageMask.cs.meta
new file mode 100644
index 0000000..473829a
--- /dev/null
+++ b/Main/Component/UI/Effect/ImageMask.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ee09ec995c4136c479e4006f2569871d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Component/UI/Effect/PostEffectsBaseEx.cs b/Main/Component/UI/Effect/PostEffectsBaseEx.cs
new file mode 100644
index 0000000..d1de0e3
--- /dev/null
+++ b/Main/Component/UI/Effect/PostEffectsBaseEx.cs
@@ -0,0 +1,52 @@
+using UnityEngine;
+using System.Collections;
+
+
+[ExecuteAlways]
+[RequireComponent(typeof(Camera))]
+//鎻愪緵涓�涓悗澶勭悊鐨勫熀绫伙紝涓昏鍔熻兘鍦ㄤ簬鐩存帴閫氳繃Inspector闈㈡澘鎷栧叆shader锛岀敓鎴恠hader瀵瑰簲鐨勬潗璐�
+public class PostEffectsBaseEx : MonoBehaviour
+{
+
+ //Inspector闈㈡澘涓婄洿鎺ユ嫋鍏�
+ public Shader shader = null;
+ private Material _material = null;
+ public Material material
+ {
+ get
+ {
+ if (_material == null)
+ _material = GenerateMaterial(shader);
+ return _material;
+ }
+ }
+
+ //鏍规嵁shader鍒涘缓鐢ㄤ簬灞忓箷鐗规晥鐨勬潗璐�
+ protected Material GenerateMaterial(Shader shader)
+ {
+ if (shader == null)
+ return null;
+ //闇�瑕佸垽鏂璼hader鏄惁鏀寔
+ if (shader.isSupported == false)
+ return null;
+ Material material = new Material(shader);
+ material.hideFlags = HideFlags.DontSave;
+ if (material)
+ return material;
+ return null;
+ }
+
+ private void OnDisable()
+ {
+ // remove material
+ if (_material)
+ {
+#if UNITY_EDITOR
+ DestroyImmediate(_material);
+#else
+ Destroy(_material);
+#endif
+ _material = null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/Component/UI/Effect/PostEffectsBaseEx.cs.meta b/Main/Component/UI/Effect/PostEffectsBaseEx.cs.meta
new file mode 100644
index 0000000..66c1031
--- /dev/null
+++ b/Main/Component/UI/Effect/PostEffectsBaseEx.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b5298cad543792440b5dfa70feb00939
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Component/UI/Effect/UIEffectPlayer.cs b/Main/Component/UI/Effect/UIEffectPlayer.cs
index 37254a2..5d70f0f 100644
--- a/Main/Component/UI/Effect/UIEffectPlayer.cs
+++ b/Main/Component/UI/Effect/UIEffectPlayer.cs
@@ -24,7 +24,7 @@
public void PlayByArrIndex(int index, bool showLog = true, bool closePMA = false)
{
var config = EffectConfig.Get(effectId);
- playSpineAnimIndex = config.animIndex[index];
+ playSpineAnimIndex = index < config.animIndex.Length ? config.animIndex[index] : 0;
PlayAsync(showLog, closePMA).Forget();
}
diff --git a/Main/Config/Configs/GuideConfig.cs b/Main/Config/Configs/GuideConfig.cs
index 68ca0a7..422390e 100644
--- a/Main/Config/Configs/GuideConfig.cs
+++ b/Main/Config/Configs/GuideConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2025骞�8鏈�5鏃�
+// [ Date ]: 2025骞�10鏈�9鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -17,17 +17,12 @@
}
public int ID;
- public int Type;
public int TriggerType;
public int Condition;
public int SupplementCondition;
+ public string WinName;
public int PreGuideId;
public int[] Steps;
- public int CanSkip;
- public int RemoveWhenOtherGuide;
- public int CannotCompleteByClick;
- public int[] UnfoldAreas;
- public int AutoCompleteTime;
public override int LoadKey(string _key)
{
@@ -41,13 +36,13 @@
string[] tables = input.Split('\t');
int.TryParse(tables[0],out ID);
- int.TryParse(tables[1],out Type);
+ int.TryParse(tables[1],out TriggerType);
- int.TryParse(tables[2],out TriggerType);
+ int.TryParse(tables[2],out Condition);
- int.TryParse(tables[3],out Condition);
+ int.TryParse(tables[3],out SupplementCondition);
- int.TryParse(tables[4],out SupplementCondition);
+ WinName = tables[4];
int.TryParse(tables[5],out PreGuideId);
@@ -64,28 +59,6 @@
int.TryParse(StepsStringArray[i],out Steps[i]);
}
}
-
- int.TryParse(tables[7],out CanSkip);
-
- int.TryParse(tables[8],out RemoveWhenOtherGuide);
-
- int.TryParse(tables[9],out CannotCompleteByClick);
-
- if (tables[10].Contains("["))
- {
- UnfoldAreas = JsonMapper.ToObject<int[]>(tables[10]);
- }
- else
- {
- string[] UnfoldAreasStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
- UnfoldAreas = new int[UnfoldAreasStringArray.Length];
- for (int i=0;i<UnfoldAreasStringArray.Length;i++)
- {
- int.TryParse(UnfoldAreasStringArray[i],out UnfoldAreas[i]);
- }
- }
-
- int.TryParse(tables[11],out AutoCompleteTime);
}
catch (Exception exception)
{
diff --git a/Main/Config/PartialConfigs/GuideConfig.cs b/Main/Config/PartialConfigs/GuideConfig.cs
new file mode 100644
index 0000000..7f78fa3
--- /dev/null
+++ b/Main/Config/PartialConfigs/GuideConfig.cs
@@ -0,0 +1,51 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public partial class GuideConfig : ConfigBase<int, GuideConfig>
+{
+ public static Dictionary<string, List<int>> winToGuidesDic = new Dictionary<string, List<int>>();
+
+ public static Dictionary<int, List<int>> typeToGuidesDic = new Dictionary<int, List<int>>();
+
+ protected override void OnConfigParseCompleted()
+ {
+ base.OnConfigParseCompleted();
+
+ List<int> list = null;
+ if (!winToGuidesDic.TryGetValue(WinName, out list))
+ {
+ list = new List<int>();
+ winToGuidesDic.Add(WinName, list);
+ }
+ list.Add(ID);
+
+ List<int> list2 = null;
+ if (!typeToGuidesDic.TryGetValue(TriggerType, out list2))
+ {
+ list2 = new List<int>();
+ typeToGuidesDic.Add(TriggerType, list2);
+ }
+ list2.Add(ID);
+ }
+
+
+ public static List<int> GetGuideListByWinName(string winName)
+ {
+ List<int> list = null;
+ if (winToGuidesDic.TryGetValue(winName, out list))
+ {
+ return list;
+ }
+ return null;
+ }
+
+ public static List<int> GetGuideListByType(int type)
+ {
+ List<int> list = null;
+ if (typeToGuidesDic.TryGetValue(type, out list))
+ {
+ return list;
+ }
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/Main/Config/PartialConfigs/GuideConfig.cs.meta b/Main/Config/PartialConfigs/GuideConfig.cs.meta
new file mode 100644
index 0000000..bc0da95
--- /dev/null
+++ b/Main/Config/PartialConfigs/GuideConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 732dbddf9b05def43a171ec3ea9b4f9d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA710_tagMCGuideState.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA710_tagMCGuideState.cs
index dab5532..46dc9eb 100644
--- a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA710_tagMCGuideState.cs
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA7_Interaction/DTCA710_tagMCGuideState.cs
@@ -1,12 +1,12 @@
-using UnityEngine;
-using System.Collections;
-
+using UnityEngine;
+using System.Collections;
+
// A7 10 寮曞鐘舵�佽褰� #tagMCGuideState
public class DTCA710_tagMCGuideState : DtcBasic {
public override void Done(GameNetPackBasic vNetPack) {
base.Done(vNetPack);
HA710_tagMCGuideState vNetData = vNetPack as HA710_tagMCGuideState;
- //NewBieCenter.Instance.ResetGuideRecords(vNetData.GuideState);
+ NewBieCenter.Instance.ResetGuideRecords(vNetData.GuideState);
}
}
diff --git a/Main/Core/ResModule/ScriptableObjectLoader.cs b/Main/Core/ResModule/ScriptableObjectLoader.cs
new file mode 100644
index 0000000..8ef9e54
--- /dev/null
+++ b/Main/Core/ResModule/ScriptableObjectLoader.cs
@@ -0,0 +1,48 @@
+锘縰sing UnityEngine;
+using System;
+
+#if UNITY_EDITOR
+using UnityEditor;
+#endif
+
+public class ScriptableObjectLoader
+{
+
+ public const string bundleName = "scriptableobjects";
+
+ public const string SoNewBieGuide_Suffix = "NewBieGuideStep_";
+
+
+
+ public static NewBieGuideScriptableObject LoadSoNewBieGuideStep(int _id)
+ {
+ NewBieGuideScriptableObject config = null;
+ if (!AssetSource.isUseAssetBundle)
+ {
+#if UNITY_EDITOR
+ var resourcePath = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath,
+ "ScriptableObject/NewBieGuide/",
+ SoNewBieGuide_Suffix,
+ _id,
+ ".asset");
+
+ config = AssetDatabase.LoadAssetAtPath<NewBieGuideScriptableObject>(resourcePath);
+#endif
+ }
+ else
+ {
+ var assetName = StringUtility.Contact(SoNewBieGuide_Suffix, _id);
+ var assetInfo = new AssetInfo(bundleName, assetName);
+ config = AssetBundleUtility.Instance.Sync_LoadAsset(assetInfo) as NewBieGuideScriptableObject;
+ }
+
+ if (config == null)
+ {
+ Debug.LogErrorFormat("ScriptableObjectLoader.LoadSoNewBieGuideStep() => 鍔犺浇涓嶅埌璧勬簮: {0}.", _id);
+ }
+
+ return config;
+ }
+
+
+}
\ No newline at end of file
diff --git a/Main/Core/ResModule/ScriptableObjectLoader.cs.meta b/Main/Core/ResModule/ScriptableObjectLoader.cs.meta
new file mode 100644
index 0000000..3ca2583
--- /dev/null
+++ b/Main/Core/ResModule/ScriptableObjectLoader.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: a931a089f7045294f91a15bc047d72e2
+timeCreated: 1504164167
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Main.cs b/Main/Main.cs
index b25dd49..c6c398f 100644
--- a/Main/Main.cs
+++ b/Main/Main.cs
@@ -83,6 +83,7 @@
managers.Add(GoldRushManager.Instance);
managers.Add(MailManager.Instance);
managers.Add(FirstChargeManager.Instance);
+ managers.Add(NewBieCenter.Instance);
foreach (var manager in managers)
{
diff --git a/Main/Manager/UIManager.cs b/Main/Manager/UIManager.cs
index e85ee58..b5e58a4 100644
--- a/Main/Manager/UIManager.cs
+++ b/Main/Manager/UIManager.cs
@@ -177,7 +177,7 @@
}
// 鑾峰彇灞傜骇瀵瑰簲鐨凾ransform
- private Transform GetTransForLayer(UILayer layer)
+ public Transform GetTransForLayer(UILayer layer)
{
// 灏濊瘯浠庣紦瀛樹腑鑾峰彇Transform
if (layerTransformCache.TryGetValue(layer, out Transform trans))
@@ -313,6 +313,18 @@
return false;
}
+
+ public bool IsOpened(string uiName)
+ {
+ UIBase ui = GetUI(uiName);
+
+ if (null != ui)
+ {
+ return ui.IsActive();
+ }
+
+ return false;
+ }
// 鑾峰彇鎸囧畾绫诲瀷鐨勬墍鏈塙I瀹炰緥
public List<T> GetAllUI<T>() where T : UIBase
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index e3d2826..76371b5 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -286,10 +286,8 @@
getReward.DataEx = (uint)TaskManager.Instance.mainTask.TaskID;
GameNetSystem.Instance.SendInfo(getReward);
}
- else
- {
- //鏍规嵁浠诲姟绫诲瀷寮曞
- }
+
+ TaskManager.Instance.ClickTask();
}
void DisplayCard(TeamType teamType)
diff --git a/Main/System/NewBieGuidance.meta b/Main/System/NewBieGuidance.meta
new file mode 100644
index 0000000..82d1e50
--- /dev/null
+++ b/Main/System/NewBieGuidance.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: bcb9714d50603ba4b8983bc75d173197
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/NewBieGuidance/GuideCircleHollowImage.cs b/Main/System/NewBieGuidance/GuideCircleHollowImage.cs
new file mode 100644
index 0000000..eb5b1d2
--- /dev/null
+++ b/Main/System/NewBieGuidance/GuideCircleHollowImage.cs
@@ -0,0 +1,25 @@
+锘縰sing System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.Sprites;
+using UnityEngine.UI;
+
+//寮曞鐢ㄧ殑鍦嗗舰闀傜┖鍥�
+public class GuideCircleHollowImage : CircleHollowImage
+{
+
+ public override bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera)
+ {
+ return true;
+
+ }
+
+ //鏄惁鍦ㄩ晜绌哄湀鍐�
+ public bool IsInCirleArea(Vector2 screenPoint, Camera eventCamera)
+ {
+ Vector2 local;
+ RectTransformUtility.ScreenPointToLocalPointInRectangle(image.rectTransform, screenPoint, eventCamera, out local);
+ return !Contains(local, outterVertices, innerVertices);
+ }
+
+
+}
diff --git a/Main/System/NewBieGuidance/GuideCircleHollowImage.cs.meta b/Main/System/NewBieGuidance/GuideCircleHollowImage.cs.meta
new file mode 100644
index 0000000..4338068
--- /dev/null
+++ b/Main/System/NewBieGuidance/GuideCircleHollowImage.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 692dc2485f4fcda48a20cb270bf673f4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/NewBieGuidance/NewBieCenter.cs b/Main/System/NewBieGuidance/NewBieCenter.cs
new file mode 100644
index 0000000..0016b04
--- /dev/null
+++ b/Main/System/NewBieGuidance/NewBieCenter.cs
@@ -0,0 +1,414 @@
+锘縰sing UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+using System;
+using LitJson;
+
+
+
+public class NewBieCenter : GameSystemManager<NewBieCenter>
+{
+ int m_CurrentGuide = 0;
+ public int currentGuide
+ {
+ get { return m_CurrentGuide; }
+ set { m_CurrentGuide = value; }
+ }
+
+ int m_GuideStep = 0;
+ public int guideStep
+ {
+ get { return m_GuideStep; }
+ private set { m_GuideStep = value; }
+ }
+
+ public bool inGuiding
+ {
+ get { return currentGuide != 0; }
+ }
+
+ List<int> allGuides = new List<int>();
+ public List<int> completeGuidesBuf = new List<int>();
+
+
+ bool inited = false;
+
+ public event Action guideStepChangeEvent;
+ public event Action guideBeginEvent;
+ public event Action<int> guideCompletedEvent;
+
+ public override void Init()
+ {
+ TaskManager.Instance.OnTaskUpdate += OnTaskUpdateEvent;
+ TaskManager.Instance.OnTaskClick += OnTaskClickEvent;
+ FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
+ PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
+ UIManager.Instance.OnOpenWindow += OnOpenWindow;
+ }
+
+ public override void Release()
+ {
+ TaskManager.Instance.OnTaskUpdate -= OnTaskUpdateEvent;
+ TaskManager.Instance.OnTaskClick -= OnTaskClickEvent;
+ FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
+ PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
+ UIManager.Instance.OnOpenWindow -= OnOpenWindow;
+ }
+
+ void OnOpenWindow(UIBase _ui)
+ {
+ var guides = GuideConfig.GetGuideListByWinName(_ui.name);
+ if (guides != null)
+ {
+ TryStartNewBieGuides(guides);
+ }
+ }
+
+ void OnTaskUpdateEvent()
+ {
+ var guides = GuideConfig.GetGuideListByType((int)GuideTriggerType.MainLineQuestCanDo);
+ if (guides != null)
+ {
+ TryStartNewBieGuides(guides);
+ }
+ }
+
+ void OnTaskClickEvent()
+ {
+ var guides = GuideConfig.GetGuideListByType((int)GuideTriggerType.MissionClick);
+ if (guides != null)
+ {
+ TryStartNewBieGuides(guides);
+ }
+ }
+
+ void OnFuncStateChangeEvent(int _funcId)
+ {
+ var guides = GuideConfig.GetGuideListByType((int)GuideTriggerType.FunctionOpen);
+ if (guides != null)
+ {
+ TryStartNewBieGuides(guides);
+ }
+ }
+
+ void PlayerDataRefresh(PlayerDataType type)
+ {
+ if (type == PlayerDataType.LV)
+ {
+ var guides = GuideConfig.GetGuideListByType((int)GuideTriggerType.Level);
+ if (guides != null)
+ {
+ TryStartNewBieGuides(guides);
+ }
+ }
+ else if (type == PlayerDataType.ExAttr1)
+ {
+ var guides = GuideConfig.GetGuideListByType((int)GuideTriggerType.Map);
+ if (guides != null)
+ {
+ TryStartNewBieGuides(guides);
+ }
+ }
+
+ }
+
+
+
+ public bool IsGuideCompleted(int guideId)
+ {
+ return completeGuidesBuf.Contains(guideId);
+ }
+
+ // 鏈嶅姟鍣ㄨ褰曠殑寮曞杩涘害
+ public void ResetGuideRecords(uint[] _guideRecords)
+ {
+ completeGuidesBuf.Clear();
+ if (_guideRecords == null || _guideRecords.Length == 0)
+ {
+ return;
+ }
+
+ for (int i = 0; i < _guideRecords.Length; i++)
+ {
+ var guideRecord = _guideRecords[i];
+ for (ushort j = 0; j < 31; j++)
+ {
+ if (MathUtility.GetBitValue(guideRecord, j))
+ {
+ completeGuidesBuf.Add(i * 31 + j);
+ }
+ }
+ }
+ }
+
+ //鎵惧嚭鍙繘琛岀殑寮曞
+ public void TryStartNewBieGuides(List<int> _guides)
+ {
+ if (!inited)
+ {
+ var allGuideConfigs = GuideConfig.GetValues();
+ foreach (var config in allGuideConfigs)
+ {
+ allGuides.Add(config.ID);
+ }
+
+ inited = true;
+ }
+
+ if (_guides == null)
+ {
+ return;
+ }
+
+ if (currentGuide != 0)
+ {
+ return;
+ }
+
+ var ok = false;
+ for (int i = 0; i < _guides.Count; i++)
+ {
+ var guideId = _guides[i];
+ if (completeGuidesBuf.Contains(guideId))
+ {
+ continue;
+ }
+
+ var config = GuideConfig.Get(guideId);
+ if (config.PreGuideId != 0 && !completeGuidesBuf.Contains(config.PreGuideId))
+ {
+ // 濡傛灉鍓嶇疆寮曞娌℃湁瀹屾垚锛屽垯璺宠繃
+ continue;
+ }
+
+ ok = CheckGuideCondition(guideId);
+ if (ok && currentGuide != guideId)
+ {
+ StartNewBieGuide(guideId);
+ break;
+ }
+ }
+
+ }
+
+
+ public void StartNewBieGuide(int _id)
+ {
+ if (_id == 0)
+ {
+ Debug.LogError("璇锋鏌ュ紩瀵糹d = 0 鐨勬儏鍐�");
+ return;
+ }
+
+ var config = GuideConfig.Get(_id);
+ if (config == null)
+ {
+ Debug.LogError($"娌℃湁璇ュ紩瀵糏D锛岃妫�鏌ュ紩瀵糹d = {_id} 鐨勬儏鍐�");
+ return;
+ }
+
+ AutoFightModel.Instance.isPause = true;
+ currentGuide = _id;
+
+ guideStep = config.Steps.Length > 0 ? config.Steps[0] : 0;
+
+ if (guideBeginEvent != null)
+ {
+ guideBeginEvent();
+ }
+
+ if (!UIManager.Instance.IsOpened<NewBieWin>())
+ {
+ UIManager.Instance.OpenWindow<NewBieWin>();
+ }
+ else
+ {
+ guideStepChangeEvent?.Invoke();
+ }
+ UIManager.Instance.CloseWindow<ChatWin>();
+
+ }
+
+ public void FinishNewBieGuide(int _id)
+ {
+ var guideRecord = currentGuide;
+ currentGuide = 0;
+
+ UIManager.Instance.CloseWindow<NewBieWin>();
+ if (!completeGuidesBuf.Contains(guideRecord))
+ {
+ completeGuidesBuf.Add(guideRecord);
+ }
+
+ var send = new CA222_tagCMSetGuideOK();
+ send.GuideIndex = (byte)_id;
+ send.IsOK = 1;
+ GameNetSystem.Instance.SendInfo(send);
+
+ if (guideCompletedEvent != null)
+ {
+ guideCompletedEvent(guideRecord);
+ }
+
+ AutoFightModel.Instance.isPause = false;
+ }
+
+ public void RemoveNewBieGuide(int _id)
+ {
+ if (!completeGuidesBuf.Contains(_id))
+ {
+ completeGuidesBuf.Add(_id);
+ }
+
+ var send = new CA222_tagCMSetGuideOK();
+ send.GuideIndex = (byte)_id;
+ send.IsOK = 1;
+ GameNetSystem.Instance.SendInfo(send);
+ }
+
+ public void FinishCurrentGuideWithoutCloseWin()
+ {
+ var guideRecord = currentGuide;
+ currentGuide = 0;
+ completeGuidesBuf.Add(guideRecord);
+
+ var send = new CA222_tagCMSetGuideOK();
+ send.GuideIndex = (byte)guideRecord;
+ send.IsOK = 1;
+ GameNetSystem.Instance.SendInfo(send);
+
+ if (guideCompletedEvent != null)
+ {
+ guideCompletedEvent(guideRecord);
+ }
+
+ AutoFightModel.Instance.isPause = false;
+ }
+
+ public void ReportGuideStepComplete(int _step)
+ {
+ if (_step == guideStep)
+ {
+ var config = GuideConfig.Get(currentGuide);
+ if (config == null)
+ {
+ guideStep = 0;
+ Debug.Log("1 FinishNewBieGuide " + _step);
+ FinishNewBieGuide(currentGuide);
+ return;
+ }
+
+ var stepIndex = Array.IndexOf(config.Steps, _step);
+ if (stepIndex < config.Steps.Length - 1)
+ {
+ guideStep = config.Steps[stepIndex + 1];
+ Debug.Log("3 FinishNewBieGuide " + _step);
+ if (guideStepChangeEvent != null)
+ {
+ guideStepChangeEvent();
+ }
+ }
+ else
+ {
+ guideStep = 0;
+ Debug.Log("2 FinishNewBieGuide " + _step);
+ FinishNewBieGuide(currentGuide);
+ }
+ }
+ }
+
+
+
+ public bool CheckGuideCondition(int _guideId)
+ {
+ var config = GuideConfig.Get(_guideId);
+ if (config == null)
+ {
+ return false;
+ }
+ if (!UIManager.Instance.IsOpened(config.WinName))
+ {
+ return false;
+ }
+
+ switch ((GuideTriggerType)config.TriggerType)
+ {
+ case GuideTriggerType.None:
+ return true;
+ case GuideTriggerType.FunctionOpen:
+ return FuncOpen.Instance.IsFuncOpen(config.Condition);
+ case GuideTriggerType.Level:
+ return PlayerDatas.Instance.baseData.LV >= config.Condition;
+ case GuideTriggerType.OpenWindow:
+ return UIManager.Instance.IsOpened(config.WinName);
+ case GuideTriggerType.MainLineQuestCanDo:
+ if (config.SupplementCondition == 2)
+ {
+ return TaskManager.Instance.mainTask.TaskID == config.Condition && TaskManager.Instance.GetMainTaskState() == 2;
+ }
+ return TaskManager.Instance.mainTask.TaskID == config.Condition;
+ case GuideTriggerType.Map:
+ return PlayerDatas.Instance.baseData.ExAttr1 >= config.Condition;
+ case GuideTriggerType.MissionClick:
+ return TaskManager.Instance.GetMainTaskType() == config.Condition;
+ default:
+ return false;
+ }
+ }
+
+ public void CompleteAllGuides()
+ {
+ var send = new CA222_tagCMSetGuideOK();
+ send.GuideIndex = 255;
+ send.IsOK = 1;
+ GameNetSystem.Instance.SendInfo(send);
+
+ currentGuide = 0;
+ UIManager.Instance.CloseWindow<NewBieWin>();
+
+ var allGuideKeys = GuideConfig.GetKeys();
+ for (int i = 0; i < allGuideKeys.Count; i++)
+ {
+ completeGuidesBuf.Add(allGuideKeys[i]);
+ }
+
+ }
+
+ public void ResetAllGuides()
+ {
+ var send = new CA222_tagCMSetGuideOK();
+ send.GuideIndex = 255;
+ send.IsOK = 0;
+ GameNetSystem.Instance.SendInfo(send);
+
+ currentGuide = 0;
+ UIManager.Instance.CloseWindow<NewBieWin>();
+
+ completeGuidesBuf.Clear();
+ }
+
+ public void ResetGuide(int _guide)
+ {
+ var send = new CA222_tagCMSetGuideOK();
+ send.GuideIndex = (byte)_guide;
+ send.IsOK = 0;
+ GameNetSystem.Instance.SendInfo(send);
+
+ completeGuidesBuf.Remove(_guide);
+ }
+
+
+
+}
+
+public enum GuideTriggerType
+{
+ None = 999, //鏃犻檺鍒� 鏁堟灉鍚�5
+ MainLineQuestCanDo = 1, //涓荤嚎浠诲姟 锛堝棣栨杩涘叆娓告垙鎸変换鍔℃帴鍙栧紩瀵硷級
+ FunctionOpen = 2, //鍔熻兘寮�鏀�
+ Map = 3, //鍦板浘锛堝叧鍗″壇鏈級 鐜╁鏁版嵁ExAttr1 20103浠h〃褰撳墠宸茬粡杩囦簡绗�2绔犵1鍏崇3娉�
+ MissionClick = 4, //鐐瑰嚮浠诲姟鎸変换鍔$被鍨嬪紩瀵�
+ OpenWindow = 5, //鎵撳紑鐣岄潰鐨勬椂鏈� 濡傝澶囨浛鎹㈢晫闈�
+ Level = 6, //绛夌骇婊¤冻鏉′欢
+
+}
\ No newline at end of file
diff --git a/Main/System/NewBieGuidance/NewBieCenter.cs.meta b/Main/System/NewBieGuidance/NewBieCenter.cs.meta
new file mode 100644
index 0000000..69483de
--- /dev/null
+++ b/Main/System/NewBieGuidance/NewBieCenter.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: db99a7a80292e504b989a2e4d29fa3e6
+timeCreated: 1501222672
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs b/Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs
new file mode 100644
index 0000000..50f948c
--- /dev/null
+++ b/Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs
@@ -0,0 +1,63 @@
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+[CreateAssetMenu(menuName = "Config/NewbieGuideStep")]
+public class NewBieGuideScriptableObject : ScriptableObject
+{
+ public int stepId;
+ public GuideType guideType;
+ public Vector2 clickPosition; //鐐瑰嚮鐩爣鐨勫亸绉婚噺
+ public Vector2 clickSize;
+ public Vector2 tipPosition;
+ public ArrowPosition arrowPosition;
+ public string UIElementPath;
+ public int effect;
+ public int voice;
+ public Vector2 usherPosition;
+ public UsherOrientation usherOrientation;
+ public int usherAction;
+ public bool clickAnyWhereComplete = false;
+ public bool clickCompleteNoMask = false; //浠绘剰鐐瑰嚮鍏抽棴 鍕鹃�夋椤逛細闅愯棌钂欑増
+
+
+
+ // 寮曞鐨勬枃鏈殑绠ご浣嶇疆
+ public enum ArrowPosition
+ {
+ None,
+ Left,
+ Right,
+ Top,
+ Bottom,
+ }
+
+ // 寮曞浜虹墿锛堝甫鏂囧瓧 绫讳技瀵硅瘽娴佺▼锛�
+ public enum UsherOrientation
+ {
+ Normal = 0, //榛樿
+ Reversal = 1 // 鍙嶅悜
+ }
+
+
+
+
+ public const string GuidesPrefixNewBie = "guide_new_";
+ public string GetTipContent()
+ {
+ return Language.Get(GuidesPrefixNewBie + stepId);
+ }
+
+ public bool HasTipContent()
+ {
+ return LanguageConfig.HasKey(GuidesPrefixNewBie + stepId);
+ }
+
+}
+
+public enum GuideType
+{
+ NewBie,
+ Function,
+ NpcTalk,
+}
diff --git a/Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs.meta b/Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs.meta
new file mode 100644
index 0000000..2c18ebf
--- /dev/null
+++ b/Main/System/NewBieGuidance/NewBieGuideScriptableObject.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 3d16610a4022c8f4eaec9f99c29cbf01
+timeCreated: 1511793683
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/NewBieGuidance/NewBieMask.cs b/Main/System/NewBieGuidance/NewBieMask.cs
new file mode 100644
index 0000000..9458826
--- /dev/null
+++ b/Main/System/NewBieGuidance/NewBieMask.cs
@@ -0,0 +1,24 @@
+锘縰sing UnityEngine;
+using System.Collections;
+
+using UnityEngine.UI;
+using UnityEngine.Events;
+
+
+public class NewBieMask : MonoBehaviour
+{
+ [SerializeField] GuideCircleHollowImage m_Mask;
+ public GuideCircleHollowImage mask { get { return m_Mask; } }
+
+ public void Display(int _guideStep, Transform _target)
+ {
+ var config = ScriptableObjectLoader.LoadSoNewBieGuideStep(_guideStep);
+ m_Mask.center = (Vector2)this.transform.InverseTransformPoint(_target.position) + config.clickPosition;
+ m_Mask.cell = config.clickSize;
+ }
+
+}
+
+
+
+
diff --git a/Main/System/NewBieGuidance/NewBieMask.cs.meta b/Main/System/NewBieGuidance/NewBieMask.cs.meta
new file mode 100644
index 0000000..d941c43
--- /dev/null
+++ b/Main/System/NewBieGuidance/NewBieMask.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 02c283f062dcc2640a944a87af02705e
+timeCreated: 1501222721
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/NewBieGuidance/NewBieWin.cs b/Main/System/NewBieGuidance/NewBieWin.cs
new file mode 100644
index 0000000..0b0588d
--- /dev/null
+++ b/Main/System/NewBieGuidance/NewBieWin.cs
@@ -0,0 +1,324 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using Cysharp.Threading.Tasks;
+using UnityEngine;
+using UnityEngine.UI;
+using DG.Tweening;
+
+//寮曞鍔熻兘鍖呭惈
+// 1.鍔熻兘寮�鍚�
+// 2.寮曞NPC瀵硅瘽
+// 3.鐐瑰嚮寮曞
+public class NewBieWin : UIBase
+{
+ [SerializeField] NewBieMask m_NewBieMask; //閬僵锛屽彲闀傜┖
+
+ //鏂板姛鑳藉紑鏀�
+ [SerializeField] Transform m_NewFunction;
+ [SerializeField] Transform m_ContainerFunctionBg; //闄勫姞璇存槑鐗规晥涓烘樉绀烘椂鎾斁 涓嶉渶瑕佷唬鐮佹帶鍒�
+ [SerializeField] Text m_FunctionName;
+ [SerializeField] Image m_FuncIcon; //鍔熻兘鍥剧墖椋炲叆瀵瑰簲浣嶇疆
+ [SerializeField] UIEffectPlayer unlockEffect; //椋炲埌瀵瑰簲鍔熻兘鍚庣垎寮�鐗规晥
+
+ //寮曞npc瀵硅瘽
+ [SerializeField] Transform m_GuideTalkRect;
+ [SerializeField] UIEffectPlayer m_newBieGuideNPC;
+ [SerializeField] Button m_ClickTalk;
+ [SerializeField] RichText m_TalkText;
+
+ //鐐瑰嚮寮曞
+ [SerializeField] Transform m_NewBieGuide;
+ [SerializeField] Transform m_ContainerDialogue;
+ [SerializeField] RichText m_Dialogue;
+ [SerializeField] Image m_ArrowUP;
+ [SerializeField] Image m_ArrowDown;
+ [SerializeField] Image m_ArrowLeft;
+ [SerializeField] Image m_ArrowRight;
+ [SerializeField] UIEffectPlayer m_ClickEffect;
+ [SerializeField] ClickScreenOtherSpace m_ClickScreenOtherSpace;
+
+
+ Transform m_ClickTarget;
+ GuideConfig config;
+ NewBieGuideScriptableObject stepConfig; //寮曞姝ラ
+
+
+ #region Built-in
+
+ protected override void InitComponent()
+ {
+ m_ClickTalk.AddListener(()=>
+ {
+ ReportStepOver();
+ });
+ }
+
+ protected override void OnPreOpen()
+ {
+ m_ClickTarget = null;
+ //鍏抽棴鍏朵粬鍙兘鍦ㄤ富鐣岄潰鏄剧ず鐨勭獥鍙g瓑
+ UIManager.Instance.CloseWindow<ChatWin>();
+ NewBieCenter.Instance.guideStepChangeEvent += OnStepChange;
+ }
+
+ protected override void OnPreClose()
+ {
+ NewBieCenter.Instance.guideStepChangeEvent -= OnStepChange;
+ if (NewBieCenter.Instance.currentGuide != 0)
+ {
+ NewBieCenter.Instance.FinishCurrentGuideWithoutCloseWin();
+ }
+ m_ClickTarget = null;
+ stepConfig = null;
+ }
+
+
+ protected override void NextFrameAfterOpen()
+ {
+ Display();
+ }
+ #endregion
+
+ void Display()
+ {
+ config = GuideConfig.Get(NewBieCenter.Instance.currentGuide);
+ if (config == null)
+ {
+ CloseWindow();
+ return;
+ }
+
+ var step = NewBieCenter.Instance.guideStep;
+ stepConfig = ScriptableObjectLoader.LoadSoNewBieGuideStep(step);
+ if (stepConfig == null)
+ {
+ CloseWindow();
+ return;
+ }
+
+
+ try
+ {
+ m_ClickTarget = FindTransform(stepConfig.UIElementPath);
+ if (m_ClickTarget != null)
+ {
+ m_lastTargetPosition = m_ClickTarget.position;
+ }
+ }
+ catch (Exception ex)
+ {
+ Debug.LogError(ex);
+ NewBieCenter.Instance.FinishNewBieGuide(NewBieCenter.Instance.currentGuide);
+ }
+
+ var type = stepConfig.guideType;
+ if (type == GuideType.NewBie && stepConfig.clickCompleteNoMask)
+ {
+ m_NewBieMask.SetActive(false);
+ }
+ else
+ {
+ m_NewBieMask.SetActive(true);
+ m_NewBieMask.Display(step, m_ClickTarget);
+ }
+
+ if (type == GuideType.Function)
+ {
+ m_NewFunction.SetActive(true);
+ m_NewBieGuide.SetActive(false);
+ m_GuideTalkRect.SetActive(false);
+ DisplayFunctionUnLock(config.Condition);
+ }
+ else if (type == GuideType.NpcTalk)
+ {
+ m_NewFunction.SetActive(false);
+ m_NewBieGuide.SetActive(false);
+ m_GuideTalkRect.SetActive(true);
+ DisplayNPCTalk();
+ }
+ else
+ {
+ m_NewFunction.SetActive(false);
+ m_NewBieGuide.SetActive(true);
+ m_GuideTalkRect.SetActive(false);
+ DisplayGuide();
+ }
+ }
+
+
+ private void DisplayFunctionUnLock(int _functionId)
+ {
+ var config = FuncOpenLVConfig.Get(_functionId);
+ m_FunctionName.text = config.Name;
+ m_FuncIcon.SetSprite(config.Icon);
+ m_ContainerFunctionBg.SetActive(true);
+ m_FuncIcon.SetActive(true);
+ m_FuncIcon.transform.localPosition = Vector3.zero;
+ unlockEffect.Stop();
+
+ Co_FunctionUnLockDelay().Forget();
+ }
+
+
+ void DisplayNPCTalk()
+ {
+ m_newBieGuideNPC.effectId = stepConfig.effect;
+ m_newBieGuideNPC.PlayByArrIndex(stepConfig.usherAction);
+ m_newBieGuideNPC.transform.localPosition = stepConfig.usherPosition;
+ m_newBieGuideNPC.transform.localScale = new Vector3(stepConfig.usherOrientation == NewBieGuideScriptableObject.UsherOrientation.Normal ? 1 : -1, 1, 1);
+ m_TalkText.text = stepConfig.GetTipContent();
+ }
+
+
+ private void DisplayGuide()
+ {
+ Co_DisplayGuide();
+ }
+
+ //瀹屾垚褰撳墠寮曞姝ラ
+ private void ReportStepOver()
+ {
+ m_ClickTarget = null;
+ NewBieCenter.Instance.ReportGuideStepComplete(NewBieCenter.Instance.guideStep);
+
+ }
+
+
+ private void OnStepChange()
+ {
+ Display();
+ }
+
+
+ async UniTask Co_FunctionUnLockDelay()
+ {
+ await UniTask.Delay(2000);
+
+ m_ContainerFunctionBg.SetActive(false);
+ unlockEffect.transform.position = m_ClickTarget.position;
+ m_FuncIcon.transform.DOMove(m_ClickTarget.position, 0.5f).SetEase(Ease.OutQuad).OnComplete(() =>
+ {
+ m_FuncIcon.SetActive(false);
+ unlockEffect.onComplete = ReportStepOver;
+ unlockEffect.Play();
+ });
+ }
+
+
+ void Co_DisplayGuide()
+ {
+ if (stepConfig.HasTipContent())
+ {
+ m_ContainerDialogue.SetActive(true);
+ m_Dialogue.text = stepConfig.GetTipContent();
+ m_ArrowUP.SetActive(stepConfig.arrowPosition == NewBieGuideScriptableObject.ArrowPosition.Top);
+ m_ArrowDown.SetActive(stepConfig.arrowPosition == NewBieGuideScriptableObject.ArrowPosition.Bottom);
+ m_ArrowLeft.SetActive(stepConfig.arrowPosition == NewBieGuideScriptableObject.ArrowPosition.Left);
+ m_ArrowRight.SetActive(stepConfig.arrowPosition == NewBieGuideScriptableObject.ArrowPosition.Right);
+ m_ContainerDialogue.transform.position = m_ClickTarget.position;
+ m_ContainerDialogue.transform.localPosition = m_ContainerDialogue.transform.localPosition + (Vector3)stepConfig.tipPosition;
+ }
+ else
+ {
+ m_ContainerDialogue.SetActive(false);
+ }
+
+ m_ClickEffect.effectId = stepConfig.effect; //濡傛灉闇�瑕佺偣鍑荤壒鏁堜篃澧炲姞鍋忕Щ閲�
+ m_ClickEffect.SetActive(true);
+ m_ClickEffect.Play();
+ m_ClickEffect.transform.position = m_ClickTarget.position;
+ m_ClickEffect.transform.localPosition = m_ClickEffect.transform.localPosition + (Vector3)stepConfig.usherPosition;
+
+ if (stepConfig.clickCompleteNoMask)
+ {
+ m_ClickScreenOtherSpace.enabled = true;
+ m_ClickScreenOtherSpace.AddListener(() =>
+ {
+ ReportStepOver();
+ });
+ }
+ else
+ {
+ m_ClickScreenOtherSpace.enabled = false;
+ m_ClickScreenOtherSpace.RemoveAllListeners();
+ }
+ }
+
+ void Update()
+ {
+ if (Input.GetMouseButtonDown(0))
+ {
+ if (stepConfig.clickAnyWhereComplete || m_NewBieMask.mask.IsInCirleArea(Input.mousePosition, CameraManager.uiCamera))
+ {
+ if (m_ClickTarget == null)
+ {
+ Debug.LogError("寮曞 m_ClickTarget == null; step = " + NewBieCenter.Instance.guideStep);
+ }
+ var btn = m_ClickTarget.GetComponent<Button>();
+ ReportStepOver();
+ if (btn != null)
+ {
+ btn.onClick.Invoke();
+ }
+ }
+
+ }
+
+ CheckTarget();
+ }
+
+ Vector3 m_lastTargetPosition;
+ //寮曞鐨勭洰鏍囧彂鐢熶綅缃彉鍖栫殑鎯呭喌
+ void CheckTarget()
+ {
+ if (m_ClickTarget == null)
+ return;
+
+ if (m_lastTargetPosition != m_ClickTarget.position)
+ {
+ Display();
+ }
+
+ }
+
+ //BaseCanvas/MainInterfaceWin/Widget_RightBottom/Container_Function/Function_Grid/Grid_6/Content/Btn_@*
+ //鍒嗗壊鎴怋aseCanvas/MainInterfaceWin/Widget_RightBottom/Container_Function/Function_Grid/Grid_6/Content 鍜� Btn_
+ //鍦╓indowCenter.Instance.uiRoot鐨� BaseCanvas/MainInterfaceWin/Widget_RightBottom/Container_Function/Function_Grid/Grid_6/Content涓嬫煡鎵句互Btn_寮�澶寸殑绗竴涓瓙鐗╀綋
+
+ //鏀寔璺緞鏈熬鍔燖*鍋氭ā绯婃煡鎵�
+ private Transform FindTransform(string path)
+ {
+ if (!path.EndsWith("@*"))
+ {
+ return UIManager.Instance.GetUIRoot().transform.Find(path);
+ }
+
+ var paths = path.Split('/');
+ var newPath = string.Join("/", paths, 0, paths.Length - 1);
+ string findName = paths[paths.Length - 1].Replace("@*", "");
+ var parent = UIManager.Instance.GetUIRoot().transform.Find(newPath);
+ if (parent == null)
+ {
+ return null;
+ }
+ var comps = parent.GetComponentsInChildren<Transform>();
+ for (int i = 0; i < comps.Length; i++)
+ {
+ if (comps[i].name.StartsWith(findName))
+ {
+ return comps[i];
+ }
+ }
+
+ return UIManager.Instance.GetUIRoot().transform.Find(path);
+ }
+
+
+
+}
+
+
+
+
+
diff --git a/Main/System/NewBieGuidance/NewBieWin.cs.meta b/Main/System/NewBieGuidance/NewBieWin.cs.meta
new file mode 100644
index 0000000..5a9fc78
--- /dev/null
+++ b/Main/System/NewBieGuidance/NewBieWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: fc299fd4d447c8246bffc13b3c03966d
+timeCreated: 1511253322
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Task/TaskManager.cs b/Main/System/Task/TaskManager.cs
index 50a481f..4dbe776 100644
--- a/Main/System/Task/TaskManager.cs
+++ b/Main/System/Task/TaskManager.cs
@@ -31,7 +31,7 @@
//涓荤嚎浠诲姟锛屾殏涓斿彧澶勭悊涓荤嚎浠诲姟
public TaskDetailDates mainTask = new TaskDetailDates();
public event Action OnTaskUpdate;
-
+ public event Action OnTaskClick;
public override void Init()
{
DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
@@ -67,6 +67,11 @@
}
+ public void ClickTask()
+ {
+ OnTaskClick?.Invoke();
+ }
+
// 浠诲姟鐘舵�� 1-杩涜涓� 2-鍙鍙�
public int GetMainTaskState()
{
@@ -75,9 +80,16 @@
//杩橀渶瀹屾垚澶氬皯涓换鍔�
public int GetNeedFinishTaskCount(int taskID)
- {
+ {
var taskConfig = TaskConfig.Get(taskID);
return taskConfig.Index - TaskConfig.Get(mainTask.TaskID).Index + 1;
}
+ public int GetMainTaskType()
+ {
+ if (mainTask.TaskID == 0)
+ return 0;
+ var taskConfig = TaskConfig.Get(mainTask.TaskID);
+ return taskConfig.TaskType;
+ }
}
diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs
index 7d02704..1d8bb3a 100644
--- a/Main/Utility/EnumHelper.cs
+++ b/Main/Utility/EnumHelper.cs
@@ -1142,17 +1142,7 @@
}
-public enum FunctionUnlockType
-{
- NoneType = 0,
- Treasure = 1,
- Normal = 2,
- TreasureSkill = 3,
- Skill = 4,
- TreasureFunc = 5,
- TreasureChapter = 6,
-}
public enum RedPointState
@@ -1319,49 +1309,8 @@
}
-public enum GuideType
-{
- NewBie = 1,
- Functional = 2,
-}
-public enum GuideTriggerType
-{
- None = 998,//鏃犻檺鍒�
- FunctionOpen = 1,//鍔熻兘寮�鏀�
- ManualFunctionOpen = 51,//鎵嬪姩鍔熻兘寮�鏀�
- Level = 2, //绛夌骇婊¤冻鏉′欢
- Treasure = 3,//娉曞疂
- EquipQuality = 4,//瑁呭鍝佽川
- Item = 5,//鎸囧畾鐗╁搧
- TreasureDungeon = 6,//娉曞疂鍓湰
- Map = 11,//鍦板浘
- RuneInlay = 12,//绗﹀嵃闀跺祵
- RealmSitDown = 13,//澧冪晫鎵撳潗
- ItemCompound = 14,//鐗╁搧鍚堟垚
- HangUpResult = 15,//鎸傛満缁撶畻
- TreasureCollectSoul = 16,//娉曞疂闆嗛瓊
- TreasureAwaken = 17,//娉曞疂瑙夐啋
- Pray = 18,//绁堟効
- VIPExperience = 19,//vip浣撻獙
- FairyLandBuyTimes = 20,//浠欑晫绉樺璐拱娆℃暟
- TeamAutoAccept = 21,//鑷姩鎺ュ彈缁勯槦閭�璇�
- TrialExchange = 22,//瀹楅棬璇曠偧鍏戞崲鏉愭枡
-
-
-
- QuestCanAccept = 100,//浠诲姟鍙帴
- MainLineQuestCanDo = 101,//浠诲姟杩涜涓�
- MainLineQuestCanAward = 102,//浠诲姟鍙濂�
- MainLineQuestLimit = 106,//浠诲姟琚檺鍒�
- MainLineQuestContinue = 110,//浠诲姟鍙户缁�
-
- BranchQuestCando = 201,//鏀嚎浠诲姟鍙仛
- BranchQuestCanAward = 202,//鏀嚎浠诲姟鍙濂�
- BranchQuestLimit = 206,//鏀嚎浠诲姟琚檺鍒�
- BranchQuestContinue = 210,//鏀嚎浠诲姟鍙户缁�
-}
public enum FuncPowerType
diff --git a/Main/Utility/UIUtility.cs b/Main/Utility/UIUtility.cs
index f4fbbb2..1ae82d0 100644
--- a/Main/Utility/UIUtility.cs
+++ b/Main/Utility/UIUtility.cs
@@ -310,24 +310,6 @@
vertexHelper.AddTriangle(currentVertCount, currentVertCount + 1, currentVertCount + 2);
}
- // public static string GetUIElementRelativePath(UIRoot _root, Transform _transform)
- // {
- // List<Transform> parents = new List<Transform>() { _transform };
- // GetParents(_transform, ref parents);
-
- // if (parents.Contains(_root.transform))
- // {
- // parents.Remove(_root.transform);
- // }
-
- // var names = new string[parents.Count];
- // for (int i = 0; i < names.Length; i++)
- // {
- // names[i] = parents[i].gameObject.name;
- // }
-
- // return string.Join("/", names);
- // }
public static void GetParents(Transform _transform, ref List<Transform> _parents)
{
@@ -344,4 +326,22 @@
}
}
+ public static string GetUIElementRelativePath(Transform _root, Transform _transform)
+ {
+ List<Transform> parents = new List<Transform>() { _transform };
+ GetParents(_transform, ref parents);
+
+ if (parents.Contains(_root))
+ {
+ parents.Remove(_root);
+ }
+
+ var names = new string[parents.Count];
+ for (int i = 0; i < names.Length; i++)
+ {
+ names[i] = parents[i].gameObject.name;
+ }
+
+ return string.Join("/", names);
+ }
}
--
Gitblit v1.8.0