【UI】新手引导

iOS_release
zhangaotian 2024-06-27 16:58:27 +08:00
parent 1943ec12cd
commit 4f32ba540d
4 changed files with 45 additions and 18 deletions

View File

@ -193,7 +193,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 200, y: 330} m_AnchoredPosition: {x: 311, y: 425}
m_SizeDelta: {x: 210, y: 147} m_SizeDelta: {x: 210, y: 147}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1732713801463255801 --- !u!222 &1732713801463255801
@ -1780,7 +1780,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 160, y: -385} m_AnchoredPosition: {x: 343, y: -507}
m_SizeDelta: {x: 210, y: 147} m_SizeDelta: {x: 210, y: 147}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4337338171065191632 --- !u!222 &4337338171065191632
@ -1910,8 +1910,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -29} m_AnchoredPosition: {x: 110, y: -24}
m_SizeDelta: {x: 60, y: 500} m_SizeDelta: {x: 54, y: 450}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7559599749038722353 --- !u!222 &7559599749038722353
CanvasRenderer: CanvasRenderer:
@ -2258,7 +2258,7 @@ MonoBehaviour:
m_Calls: [] m_Calls: []
m_text: 'UserID:' m_text: 'UserID:'
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 7944e7f1ee22bb14fa3a310fd16e8092, type: 2} m_fontAsset: {fileID: 0}
m_sharedMaterial: {fileID: -5302180806271213227, guid: 7944e7f1ee22bb14fa3a310fd16e8092, m_sharedMaterial: {fileID: -5302180806271213227, guid: 7944e7f1ee22bb14fa3a310fd16e8092,
type: 2} type: 2}
m_fontSharedMaterials: [] m_fontSharedMaterials: []

View File

@ -31,19 +31,11 @@ namespace Framework.Constants
public const int PopUpLimitNumber = 8; public const int PopUpLimitNumber = 8;
public const int LevelRateIndex = 4; public const int LevelRateIndex = 4;
//获胜飞金币
public static Vector3 CoinGfxPos = new Vector3(-1.5f, -4f, 0f); //生成金币固定位置
public const float SpawnInterval = 0.1f; // 生成金币的间隔时间
public const int MaxGfxCoinsNumber = 15; //生成金币最大数量
/// <summary> /// <summary>
/// 关卡选择 一页数量 /// 关卡选择 一页数量
/// </summary> /// </summary>
public const int LevelSelectCount = 15; public const int LevelSelectCount = 15;
//数字变化速度
public const float CoinChangeSpeed = 1f;
//通关奖励 //通关奖励
public const int RewardCoin = 20; public const int RewardCoin = 20;

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using Framework.Constants; using Framework.Constants;
using Gameplay.Manager; using Gameplay.Manager;
using System.Linq;
using UnityEngine; using UnityEngine;
using PhxhSDK; using PhxhSDK;
using System; using System;
@ -15,6 +16,8 @@ namespace Gameplay.Level
private Dictionary<string, Kong> _holeDic; private Dictionary<string, Kong> _holeDic;
public Dictionary<string, Kong> HoleDic => _holeDic; public Dictionary<string, Kong> HoleDic => _holeDic;
public List<Kong> HoleList;
private List<Vector3> _addedNewHolesPos; private List<Vector3> _addedNewHolesPos;
private List<Kong> _addedNewHoles; private List<Kong> _addedNewHoles;
@ -67,6 +70,7 @@ namespace Gameplay.Level
_addedNewHolesPos = LevelUtils.GetAdditionalAddedHolesPos(new Vector3(xPos[0], yPos[^1], 0f), _addedNewHolesPos = LevelUtils.GetAdditionalAddedHolesPos(new Vector3(xPos[0], yPos[^1], 0f),
LevelManager.Instance.CurrentLevel.LevelData.columnCount); LevelManager.Instance.CurrentLevel.LevelData.columnCount);
HoleList = _holeDic.Values.ToList();
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -3,6 +3,7 @@ using System;
using UnityEngine; using UnityEngine;
using Framework.BI; using Framework.BI;
using Framework.UI; using Framework.UI;
using Gameplay.Level;
using UnityEngine.UI; using UnityEngine.UI;
using Framework.Event; using Framework.Event;
using Gameplay.Manager; using Gameplay.Manager;
@ -26,6 +27,14 @@ public class UILevelPanelController : UIWindow
private float _txtOldTime; private float _txtOldTime;
private bool _gfxAddTimeShow; private bool _gfxAddTimeShow;
//新手引导
private GameObject _newGuideObj1;
private GameObject _newGuideObj2;
private GameObject _imgArrow;
private GameObject _imgFinger;
private GameObject _imgFinger2;
protected override void OnAwake() protected override void OnAwake()
{ {
RegisterEvent(); RegisterEvent();
@ -57,9 +66,31 @@ public class UILevelPanelController : UIWindow
_timeAnimator = FindObj("UI_LiuHaiTop/Txt_Time").GetComponent<Animator>(); _timeAnimator = FindObj("UI_LiuHaiTop/Txt_Time").GetComponent<Animator>();
//新手引导 //新手引导
_newbieGuide = FindObj("NewbieGuide").gameObject;
if (LevelManager.Instance.IsNewbieGuide) if (LevelManager.Instance.IsNewbieGuide)
{
InitNewGuide();
}
}
private void InitNewGuide()
{
_newbieGuide = FindObj("NewbieGuide").gameObject;
FindObj("UI_LiuHaiTop/Txt_Time").gameObject.SetActive(false); FindObj("UI_LiuHaiTop/Txt_Time").gameObject.SetActive(false);
_newGuideObj1 = KongManager.Instance.HoleList[0].Obj;
_newGuideObj2 = KongManager.Instance.HoleList[^1].Obj;
_imgFinger = FindObj("NewbieGuide/img_Finger");
_imgFinger2 = FindObj("NewbieGuide/img_Finger2");
_imgArrow = FindObj("NewbieGuide/img_Arrow");
if (_newGuideObj2 != null && _newGuideObj1 != null)
{
_imgFinger.transform.position = new Vector3(_newGuideObj2.transform.position.x + 1f,
_newGuideObj1.transform.position.y, _newGuideObj1.transform.position.z);
_imgFinger2.transform.position = new Vector3(_newGuideObj2.transform.position.x + 1f,
_newGuideObj2.transform.position.y, _newGuideObj1.transform.position.z);
_imgArrow.transform.position = new Vector3(_newGuideObj2.transform.position.x,
_imgArrow.transform.position.y, _newGuideObj1.transform.position.z);
}
} }
private void Start() private void Start()
@ -185,9 +216,9 @@ public class UILevelPanelController : UIWindow
private void NewbieGuideNext() private void NewbieGuideNext()
{ {
FindObj("NewbieGuide/img_Arrow").gameObject.SetActive(true); _imgArrow.gameObject.SetActive(true);
FindObj("NewbieGuide/img_Finger2").gameObject.SetActive(true); _imgFinger2.gameObject.SetActive(true);
FindObj("NewbieGuide/img_Finger").gameObject.SetActive(false); _imgFinger.gameObject.SetActive(false);
} }
private void NewbieGuideFinish() private void NewbieGuideFinish()