1、在物品栏选择物品时,若点击了错误的物品,则弹出错误提示(弹窗及提示文字见UI)

2、所有正确物品都被点击后,则弹出完成提示弹窗“物品准备已完成”(弹窗样式见UI)
This commit is contained in:
“CongG” 2025-01-15 19:06:25 +08:00
parent bdce4d278a
commit d076b3917a
6 changed files with 54 additions and 19 deletions

View File

@ -183,7 +183,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.5019608}
m_Color: {r: 0, g: 0, b: 0, a: 0}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1

View File

@ -183,7 +183,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.5019608}
m_Color: {r: 0, g: 0, b: 0, a: 0}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1

View File

@ -704,9 +704,10 @@ namespace ZXK.LouDiXvMuNiu
}
else
{
PopUpMng.PopChoseErrowToast(_CurSceneStep.ExamEvvr, 2.0f);
useBts.Clear();
addScoreTemp = false;
PopUpMng.PopChoseErrorToast(_CurSceneStep.ExamEvvr, 2.0f,()=> {
useBts.Clear();
addScoreTemp = false;
});
}
}

View File

@ -234,17 +234,23 @@ namespace ZXK.LouDiXvMuNiu
if (obj.ThreeTaskName != GameManager.Instance._DataNiuHandler.CurNiuHandler.PreviousValue.ThreeTaskName)
{//前后三级人物名字不同
List<NiuData> tempData = GameManager.Instance._DataNiuHandler.NiuStepTypeDic[GameManager.Instance._CurModelType];
int prepareGeoID = 0;
for (int i = 0; i < tempData.Count; i++)
if (GameManager.Instance._StateContext.GetState().Name.Equals("TrainState"))
{
if (tempData[i].ThreeTaskName == ConstCtrl.ThreeTaskName_PrepareGeo)
List<NiuData> tempData = GameManager.Instance._DataNiuHandler.NiuStepTypeDic[GameManager.Instance._CurModelType];
int prepareGeoID = 0;
for (int i = 0; i < tempData.Count; i++)
{
prepareGeoID = tempData[i].id;
if (tempData[i].ThreeTaskName == ConstCtrl.ThreeTaskName_PrepareGeo)
{
prepareGeoID = tempData[i].id;
}
}
_nextBtn.gameObject.SetActive(obj.id <= prepareGeoID);
}
else
{
_nextBtn.gameObject.SetActive(false);
}
_nextBtn.gameObject.SetActive(obj.id <= prepareGeoID);
NiuSceneMng._Instance.InitPlayAnmState(obj, GameManager.Instance._DataNiuHandler.CurNiuHandler.PreviousValue);
}
UodateCameraTRID(obj);

View File

@ -16,6 +16,8 @@ namespace ZXK.LouDiXvMuNiu
private GameObject _toolItemPrefab = null;
private List<GameObject> _toolBtnArray = new List<GameObject>();
private int _allTools = 0;
private int _curToolNumber = 0;
protected override void Awake()
{
@ -42,6 +44,7 @@ namespace ZXK.LouDiXvMuNiu
string itemErroTools= tempData[i].OptionErro;
if (string.IsNullOrEmpty(itemTools)) continue;
string[] rightTools = itemTools.Split("|");
_allTools = rightTools.Length;
string[] erroTools = itemErroTools.Split("|");
string[] allTools = new string[rightTools.Length + erroTools.Length];
rightTools.CopyTo(allTools, 0);
@ -77,11 +80,22 @@ namespace ZXK.LouDiXvMuNiu
toolItemGeo.transform.Find("BeUseImg/ChoseRight").gameObject.SetActive(true);
GameManager.Instance._EventManager.Raise(new ClickToolArgs() { SelectTool = toolItemGeo.name });
GameManager.Instance._DataNiuHandler.AddScore(curStep.ModuleName, curStep.ThreeTaskName, 1);
_curToolNumber++;
if (_curToolNumber == _allTools)
{
PopUpMng.PopChoseRightToast("Æ÷е׼±¸ÒÑÍê³É", 2.0f,()=> {
NiuData nextStep = GameManager.Instance._DataNiuHandler.GetNextStep();
GameManager.Instance._DataNiuHandler.CurNiuHandler.Value = nextStep;
});
}
}
else
{
toolItemGeo.transform.Find("BeUseImg").gameObject.SetActive(true);
toolItemGeo.transform.Find("BeUseImg/ChoseError").gameObject.SetActive(true);
PopUpMng.PopChoseErrorToast(curStep.ExamEvvr, 2.0f, () => {
toolItemGeo.transform.Find("BeUseImg").gameObject.SetActive(true);
toolItemGeo.transform.Find("BeUseImg/ChoseError").gameObject.SetActive(true);
});
}
});
toolItemGeo.SetActive(true);

View File

@ -120,7 +120,7 @@ namespace CG.UTility
/// <summary>
/// 弹出选择错误提示
/// </summary>
public static void PopChoseErrowToast(string content, float stayTime, UIGroup group = UIGroup.Tip)
public static void PopChoseErrorToast(string content, float stayTime, System.Action closeEvent, UIGroup group = UIGroup.Tip)
{
_TriAble = false;
GameObject toastGeo = UI_Manage.Instance.ShowPanel("ChoseErrorTip", System.Type.GetType("CG.Framework.UIBase"), group);
@ -129,21 +129,35 @@ namespace CG.UTility
toastGeo.transform.SetAsLastSibling();
if (stayTime > 0)
{
_TriAble = true;
GameObject.Destroy(toastGeo, stayTime);
float a = 0;
DOTween.To(() => a, x => a = x, stayTime, stayTime).OnComplete(() =>
{
_TriAble = true;
closeEvent?.Invoke();
GameObject.Destroy(toastGeo);
});
}
}
/// <summary>
/// 弹出准备完成提示
/// </summary>
public static void PopChoseRightToast(string content, float stayTime, UIGroup group = UIGroup.Tip)
public static void PopChoseRightToast(string content, float stayTime, System.Action closeEvent, UIGroup group = UIGroup.Tip)
{
_TriAble = false;
GameObject toastGeo = UI_Manage.Instance.ShowPanel("ChoseRightTip", System.Type.GetType("CG.Framework.UIBase"), group);
toastGeo.name = "ChoseRightTip";
toastGeo.transform.Find("Mask/ChoseRight/DescText").GetComponent<Text>().text = content;
toastGeo.transform.SetAsLastSibling();
if (stayTime > 0)
GameObject.Destroy(toastGeo, stayTime);
{
float a = 0;
DOTween.To(() => a, x => a = x, stayTime, stayTime).OnComplete(() =>
{
_TriAble = true;
closeEvent?.Invoke();
GameObject.Destroy(toastGeo);
});
}
}
/// <summary>