This commit is contained in:
2024-10-16 00:03:41 +08:00
commit 897058435c
5033 changed files with 1009728 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
using Framework.Timer;
using UnityEngine;
using UnityEngine.Events;
namespace System.Guide
{
public class AutoGuideListener : MonoBehaviour
{
public AutoGuideListener NextGuideListener;
public string GuideTable;
public GuideNode GuideNode;
public bool IsAutoStart;
public float DelayTime;
private TimeHandler _timeHandler;
public UnityEvent CompleteGuideEvent;
public void NextGuide ()
{
if (GuideMgr.Instance.HasGuiding (this.GuideTable))
{
GuideMgr.Instance.NextNode (GuideMgr.Instance.CurGuideNode);
}
}
public void CompleteGuide ()
{
if (GuideMgr.Instance.HasGuiding (this.GuideTable))
{
GuideMgr.Instance.CompleteGuide ();
this.CompleteGuideEvent?.Invoke ();
if (!ReferenceEquals (this.NextGuideListener , default))
{
this.NextGuideListener.CheckGuide ();
}
}
}
private void OnEnable ()
{
if (IsAutoStart)
{
CheckGuide ();
}
}
public void CheckGuide ()
{
this._timeHandler?.Kill ();
this._timeHandler = GameUpdateMgr.Instance.CreateTimer (this.DelayTime , () =>
{
if (GuideMgr.Instance.HasGuide (this.GuideTable))
{
this.gameObject.SetActive (false);
if (!ReferenceEquals (this.NextGuideListener , default))
{
this.NextGuideListener.CheckGuide ();
}
return;
}
this.gameObject.SetActive (true);
GuideMgr.Instance.PlayGuide (this.GuideNode , this.GuideTable);
});
}
private void OnDisable ()
{
this._timeHandler?.Kill ();
if (IsAutoStart)
{
GuideMgr.Instance.StopGuide (this.GuideTable);
}
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9affb4ff61f1417794c0ebf37eabc1ac
timeCreated: 1695205709

View File

@@ -0,0 +1,137 @@
using System;
using System.Collections.Generic;
using System.Guide;
using Framework.Timer;
using Framework.UI;
using Framework.Utils;
using Framework.Utils.UITools;
using UnityEngine;
using UnityEngine.UI;
using IcecreamView;
using TMPro;
using Utils;
using CameraType = Framework.Utils.CameraType;
namespace Views
{
public class CommonGuidePanel : IcecreamView.IC_AbstractModule
{
[SerializeField] private RectTransform _mask;
[SerializeField] private RectTransform _target;
[SerializeField] private RectTransform _tipWindow;
[SerializeField] private TMP_Text _tipText;
private Vector3 _basePosition;
private Transform _baseParent;
private GuideNode _node;
private int _objectIndex;
private AdjustBox _adjustBox;
public override void OnInitView ()
{
this._node = null;
GameUpdateMgr.Instance.AddUpdater (DoUpdate);
this._adjustBox = new AdjustBox (CameraGroup.Instance.GetCamera (CameraType.Ui) , (RectTransform)this.transform , _tipWindow ,
new Vector2Int (1, 1));
}
private void DoUpdate ()
{
if (ReferenceEquals (this._node , null))
{
return;
}
if (ReferenceEquals (this._node , default))
{
this.ViewConnector.CloseView ();
return;
}
if (!_node.IsMask)
{
var screenPoint = UIKit.WorldPointToScreenPoint (this._node.transform.position ,
CameraGroup.Instance.GetCamera (this._node.fromCameraType) );
this._target.anchoredPosition
= UIKit.ScreenPointToUILocalPoint (CameraGroup.Instance.GetCamera (CameraType.Ui) , this._mask , screenPoint );
this._target.sizeDelta = ((RectTransform)(this._node.transform)).rect.size;
}
this._adjustBox.ExpendDistance = this._node.guideWindowExpend;
this._adjustBox.AutoController (this._target);
}
public override void OnOpenView (IC_ViewData parameters)
{
ResetNode ();
this._node = parameters.GetValue<GuideNode> ();
Transform nodeTransform;
this._objectIndex = (nodeTransform = this._node.transform).GetSiblingIndex ();
this._baseParent = nodeTransform.parent;
this._basePosition = nodeTransform.position;
SetNode ();
}
public override void OnCloseView ()
{
ResetNode ();
}
private void OnDestroy ()
{
GameUpdateMgr.Instance.RemoveUpdater (DoUpdate);
}
private void SetNode ()
{
this._mask.gameObject.SetActive (this._node.IsMask);
var screenPoint = UIKit.WorldPointToScreenPoint (this._node.transform.position ,
CameraGroup.Instance.GetCamera (this._node.fromCameraType) );
if (this._node.IsMask)
{
this._node.transform.SetParent (this.transform , false);
this._node.transform.SetAsLastSibling ();
}
this._target.anchoredPosition
= UIKit.ScreenPointToUILocalPoint (CameraGroup.Instance.GetCamera (CameraType.Ui) , this._mask , screenPoint );
if (_node.IsMask)
{
this._node.transform.position = _target.position;
}
this._target.sizeDelta = ((RectTransform)(this._node.transform)).rect.size;
this._adjustBox.ExpendDistance = this._node.guideWindowExpend;
this._adjustBox.AutoController (this._target);
this._tipWindow.transform.SetAsLastSibling ();
this._tipText.text = this._node.Tip;
this._tipWindow.gameObject.SetActive (!string.IsNullOrEmpty (this._node.Tip));
}
private void ResetNode ()
{
if (this._node != null)
{
if (this._baseParent == null)
{
Destroy (this._node.gameObject);
}
else if (this._node.transform.parent != this._baseParent)
{
// var screenPoint = UIKit.WorldPointToScreenPoint (this._node.transform.position ,
// CameraGroup.Instance.GetCamera (CameraType.Ui) );
this._node.transform.SetParent (this._baseParent, false);
this._node.transform.SetSiblingIndex (this._objectIndex);
if (_node.IsMask)
{
_node.transform.position = _basePosition;
}
}
this._node = null;
}
}
}
}

View File

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

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a5583a7055664ee58c0b563c82ac4528
timeCreated: 1703132569

View File

@@ -0,0 +1,668 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &741611980
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 741611981}
- component: {fileID: 741611984}
- component: {fileID: 741611983}
- component: {fileID: 741611982}
m_Layer: 6
m_Name: TouchImg
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &741611981
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 741611980}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1507782146}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: -88, y: 90.68}
m_SizeDelta: {x: 97.27, y: 123.17}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &741611984
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 741611980}
m_CullTransparentMesh: 1
--- !u!114 &741611983
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 741611980}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, 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_Sprite: {fileID: 21300000, guid: 364d8bfaa9a6a17409ee36c7268d1a3c, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &741611982
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 741611980}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 13792d2bb6eb4041ab22c21871f017d0, type: 3}
m_Name:
m_EditorClassIdentifier:
IsAutoPlay: 1
MintPlayer:
TweenOptions:
Duration: 1.5
IsBack: 1
IsFlip: 0
IsLoop: 1
LoopCount: -1
IsCustomEase: 0
EaseType: 16
TimeCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
UpdaterTypeEnum: 2
TweenType: 1
IsLocal: 0
IsAutoStartValue: 0
StartValue: {x: -88, y: 90.68, z: 0}
EndValue: {x: -47.95, y: 61.9, z: 0}
--- !u!1 &1507782145
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1507782146}
- component: {fileID: 1507782148}
- component: {fileID: 1507782147}
m_Layer: 6
m_Name: TipWindow
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1507782146
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1507782145}
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1512566055}
- {fileID: 741611981}
m_Father: {fileID: 7570111234506437642}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 52.46, y: 0}
m_SizeDelta: {x: 334.26, y: 181.36}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1507782148
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1507782145}
m_CullTransparentMesh: 1
--- !u!114 &1507782147
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1507782145}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, 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_Sprite: {fileID: 21300000, guid: 10f84157577fd834a9b82ac0f988f988, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &1512566054
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1512566055}
- component: {fileID: 1512566057}
- component: {fileID: 1512566056}
m_Layer: 6
m_Name: TipText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1512566055
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1512566054}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1507782146}
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.68, y: -37.38}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1512566057
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1512566054}
m_CullTransparentMesh: 1
--- !u!114 &1512566056
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1512566054}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, 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_text: New Text
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 5dcab017ddccbcd4da61e248dfc57bc1, type: 2}
m_sharedMaterial: {fileID: 683438811382067685, guid: 5dcab017ddccbcd4da61e248dfc57bc1, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 26
m_fontSizeBase: 26
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 26
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &2339922805552579712
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 533344786560107895}
- component: {fileID: 1815524694008329653}
- component: {fileID: 2492136855255986972}
m_Layer: 6
m_Name: Target
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &533344786560107895
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2339922805552579712}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7570111234506437642}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1815524694008329653
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2339922805552579712}
m_CullTransparentMesh: 1
--- !u!114 &2492136855255986972
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2339922805552579712}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &7570111234506437643
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7570111234506437642}
- component: {fileID: 7570111234506437640}
- component: {fileID: 7570111234506437879}
- component: {fileID: 8982029749468453688}
- component: {fileID: 4782824658131308325}
m_Layer: 6
m_Name: CommonGuidePanel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7570111234506437642
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7570111234506437643}
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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 9191627647661592121}
- {fileID: 533344786560107895}
- {fileID: 1507782146}
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!222 &7570111234506437640
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7570111234506437643}
m_CullTransparentMesh: 1
--- !u!114 &7570111234506437879
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7570111234506437643}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6e508df29ae543c1b81af56733b93d54, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
_color: {r: 0.51, g: 0, b: 0, a: 0.67}
IsDebug: 0
--- !u!114 &8982029749468453688
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7570111234506437643}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7783ab86db5640e4485e3aff12200852, type: 3}
m_Name:
m_EditorClassIdentifier:
HasAutoCreate: 1
VIEWTABLE:
hasFocusView: 0
isOpen: 0
isOnce: 0
DefaultStory: 30
--- !u!114 &4782824658131308325
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7570111234506437643}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ead43bfc88b43d54a8f8ead00f003218, type: 3}
m_Name:
m_EditorClassIdentifier:
prioritylevel: 1
IsActiveUIBinder: 1
ViewConnector: {fileID: 0}
_mask: {fileID: 9191627647661592121}
_target: {fileID: 533344786560107895}
_tipWindow: {fileID: 1507782146}
_tipText: {fileID: 1512566056}
--- !u!1 &9191627647661592122
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 9191627647661592121}
- component: {fileID: 9191627647661592119}
- component: {fileID: 9191627647661592120}
- component: {fileID: 9191627647661592117}
- component: {fileID: 9191627647661592118}
m_Layer: 6
m_Name: Mask
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &9191627647661592121
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9191627647661592122}
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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7570111234506437642}
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!222 &9191627647661592119
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9191627647661592122}
m_CullTransparentMesh: 1
--- !u!114 &9191627647661592120
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9191627647661592122}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.61960787}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!225 &9191627647661592117
CanvasGroup:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9191627647661592122}
m_Enabled: 1
m_Alpha: 1
m_Interactable: 1
m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0
--- !u!114 &9191627647661592118
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9191627647661592122}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 32ce154d21b948608e0ced1e7bbb698e, type: 3}
m_Name:
m_EditorClassIdentifier:
IsAutoPlay: 1
MintPlayer:
TweenOptions:
Duration: 0.75
IsBack: 0
IsFlip: 0
IsLoop: 0
LoopCount: -1
IsCustomEase: 0
EaseType: 0
TimeCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
UpdaterTypeEnum: 2
TweenType: 1
IsLocal: 0
IsAutoStartValue: 0
StartValue: 0
EndValue: 1

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 38fb4f3c1cfb3f740882f7839d7e897c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,119 @@
using Framework.Save;
using Framework.Timer;
using Framework.UI;
using Framework.Utils.SingletonTemplate;
using IcecreamView;
using Views;
namespace System.Guide
{
public class GuideMgr : MgrBase<GuideMgr>
{
protected override void OnCreateMge ()
{
}
private string _curGuideTable;
private GuideNode _curGuideNode;
private Action _callback;
public GuideNode CurGuideNode => this._curGuideNode;
public bool HasGuiding (string guideTable) => string.Equals (guideTable , this._curGuideTable);
public bool HasGuiding() => !string.IsNullOrEmpty(this._curGuideTable);
public bool HasGuide (string guideTable)
{
return Account.Instance.AccountSystemData.CompleteGuideTable.Contains (guideTable);
}
public void RemoveGuide (string guideTable)
{
Account.Instance.AccountSystemData.CompleteGuideTable.Remove (guideTable);
Account.Instance.Save(SaveData.System);
}
public void PlayGuide (GuideNode node , string guideTable , Action callback = null)
{
if (HasGuide(guideTable))
{
return;
}
this._callback = callback;
this._curGuideTable = guideTable;
node.StartNode ();
}
public void StopGuide (string guideTable)
{
if (!string.IsNullOrEmpty (guideTable) && HasGuide(guideTable))
{
return;
}
ResetData ();
}
public void StopGuide ()
{
if (UIManager.Instance.IsOpenedView (UIPanel.GuidePanel))
{
UIManager.Instance.CloseView (UIPanel.GuidePanel);
}
ResetData ();
}
/// <summary>
/// 直接完成当前任务引导,不管是否完成了所有节点
/// </summary>
public void CompleteGuide ()
{
Account.Instance.AccountSystemData.CompleteGuideTable.Add (this._curGuideTable);
Account.Instance.Save(SaveData.System);
var callback = this._callback;
ResetData ();
callback?.Invoke ();
}
private void ResetData ()
{
if (!ReferenceEquals (this._curGuideNode , default))
{
this._curGuideNode.OnGuidedLogic ();
}
this._curGuideNode = null;
this._callback = null;
this._curGuideTable = null;
}
internal void ShowGuideNode(GuideNode node)
{
this._curGuideNode = node;
this._curGuideNode.OnGuidingLogic ();
}
internal void NextNode (GuideNode node)
{
if (!ReferenceEquals (this._curGuideNode , default))
{
this._curGuideNode.OnGuidedLogic ();
}
if (node.nextNode != null)
{
node.nextNode.StartNode ();
}
else
{
CompleteGuide ();
}
}
public void NextCurNode ()
{
if (!ReferenceEquals (this._curGuideNode , default))
{
this._curGuideNode.NextNode ();
}
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 090e4d1fb9d14d358a5d8cb32af97f3b
timeCreated: 1695194449

View File

@@ -0,0 +1,62 @@
using System.Guide.TriggerModel;
using Framework.UI;
using UnityEngine;
using Framework.Utils;
using IcecreamView;
using UnityEngine.Serialization;
using Views;
using CameraType = Framework.Utils.CameraType;
namespace System.Guide
{
public class GuideNode : MonoBehaviour
{
[SerializeField, TextArea] internal string Tip;
[SerializeField] internal bool IsMask;
[SerializeField] internal GuideNode nextNode;
[SerializeField] internal CameraType fromCameraType = CameraType.Base;
[SerializeField] internal Vector2 guideWindowExpend = new Vector2 (65 , 65);
[SerializeField] internal BaseGuideTrigger _guideTrigger;
public int code;
private bool _isInit;
internal virtual void StartNode ()
{
GuideMgr.Instance.ShowGuideNode (this);
if (!this._isInit)
{
this._isInit = true;
this.OnInit ();
}
if (!ReferenceEquals (this._guideTrigger , default))
{
this._guideTrigger.OnNodeActive (this);
}
}
public virtual void NextNode ()
{
if (!ReferenceEquals (this._guideTrigger , default))
{
this._guideTrigger.OnNodeDeActive (this);
}
GuideMgr.Instance.NextNode (this);
}
internal virtual void OnGuidingLogic ()
{
UIManager.Instance.OpenView (UIPanel.GuidePanel , new IC_ViewData (this));
}
internal virtual void OnGuidedLogic ()
{
UIManager.Instance.CloseView (UIPanel.GuidePanel);
}
protected virtual void OnInit ()
{
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d10246066e014a78bd99fe143dfeec19
timeCreated: 1695194502

View File

@@ -0,0 +1,16 @@
using UnityEngine.UI;
namespace System.Guide
{
public class GuideNode_Button : GuideNode
{
public Button CompleteButton;
protected override void OnInit ()
{
if (!ReferenceEquals(CompleteButton, default))
{
this.CompleteButton.onClick.AddListener (this.NextNode);
}
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7e8e43326000425c8000567446c9af36
timeCreated: 1695196974

View File

@@ -0,0 +1,28 @@
using Framework.UI;
using Sirenix.Utilities;
using UnityEngine;
using Views;
namespace System.Guide
{
public class GuideNode_TipWindow : GuideNode
{
[SerializeField] private string Title;
internal override void OnGuidingLogic ()
{
if (!string.IsNullOrWhiteSpace (this.Title))
{
UIManager.Instance.OpenTip (this.Title, this.Tip , NextNode);
}
else
{
UIManager.Instance.OpenTip (this.Tip , NextNode);
}
}
internal override void OnGuidedLogic ()
{
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2d637f5cb7164d6aaee9c2f0e514b606
timeCreated: 1709626732

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9e1004cfeccd46899ded970f56fade2b
timeCreated: 1709625679

View File

@@ -0,0 +1,11 @@
using UnityEngine;
namespace System.Guide.TriggerModel
{
public abstract class BaseGuideTrigger : MonoBehaviour
{
internal abstract void OnNodeActive (GuideNode node);
internal abstract void OnNodeDeActive (GuideNode node);
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c7e9b6602d254918baeac62f7056ed9c
timeCreated: 1709625796

View File

@@ -0,0 +1,33 @@
using UnityEngine.UI;
namespace System.Guide.TriggerModel
{
public class ScreenTouchTrigger : BaseGuideTrigger
{
public Button _Button;
private GuideNode _curGuideNode;
private void Awake ()
{
this._Button.onClick.AddListener (OnTrigger);
this._Button.gameObject.SetActive (false);
}
private void OnTrigger ()
{
this._curGuideNode.NextNode ();
}
internal override void OnNodeActive (GuideNode node)
{
this._curGuideNode = node;
this._Button.gameObject.SetActive (true);
}
internal override void OnNodeDeActive (GuideNode node)
{
this._curGuideNode = null;
this._Button.gameObject.SetActive (false);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f5401be55d8c432a87e152f9bfc119d7
timeCreated: 1709625755