110 lines
2.9 KiB
C#
110 lines
2.9 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
public class plantPart
|
|
{
|
|
public string partName;
|
|
public string partIntro;
|
|
}
|
|
|
|
public class allPlant
|
|
{
|
|
public string plantName;
|
|
public List<plantPart> plantParts;
|
|
}
|
|
|
|
public class plantsInfo
|
|
{
|
|
public List<allPlant> allPlants;
|
|
}
|
|
|
|
public class UI_GraphicRextualPanel : BasePanel
|
|
{
|
|
public RawImage rawImage;
|
|
|
|
//¶¥²¿ÎÄ×Ö
|
|
public TextMeshProUGUI ToptextMeshProUGUI;
|
|
|
|
//ÄÚÈÝ
|
|
public TextMeshProUGUI ContentTextMeshProUGUI;
|
|
|
|
//public RawImageScript rawImageScript_Left;
|
|
//public RawImageScript rawImageScript_Right;
|
|
|
|
public plantsInfo plantsInfo;
|
|
|
|
public void Init()
|
|
{
|
|
plantsInfo = JsonManager.Instance.LoadData<plantsInfo>("plantsInfo");
|
|
ToptextMeshProUGUI.text = "";
|
|
ContentTextMeshProUGUI.text = "";
|
|
}
|
|
|
|
public void showPlantPartOnRawImage(GameObject partObj)
|
|
{
|
|
ToptextMeshProUGUI.text = "";
|
|
ContentTextMeshProUGUI.text = "";
|
|
|
|
plantsInfo.allPlants.ForEach(plant =>
|
|
{
|
|
if (partObj.transform.parent.gameObject.name == plant.plantName)
|
|
{
|
|
string title = plant.plantName + ":";
|
|
plant.plantParts.ForEach(part =>
|
|
{
|
|
if (partObj.name == part.partName)
|
|
{
|
|
ToptextMeshProUGUI.text = (title += part.partName);
|
|
ContentTextMeshProUGUI.text = part.partIntro;
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
}
|
|
public override void ShowMe()
|
|
{
|
|
base.ShowMe();
|
|
}
|
|
public override void HideMe()
|
|
{
|
|
base.HideMe();
|
|
}
|
|
protected override void OnClick(string btnName)
|
|
{
|
|
switch (btnName)
|
|
{
|
|
case "returnBtn":
|
|
GameManager.UIMgr.ShowPanel<UI_MenuBar>(E_UI_Layer.Mid, panel => { panel.Init(); });
|
|
GameManager.UIMgr.ShowPanel<UI_GrowthPeriodPanel>(E_UI_Layer.Mid, (panel) => { panel.Init(); });
|
|
GameManager.UIMgr.ShowPanel<UI_TaskListPanel>(E_UI_Layer.Top, panel =>
|
|
{
|
|
panel.Init
|
|
(
|
|
GameManager.ProcessMgr.subProcessId
|
|
);
|
|
});
|
|
GameManager.UIMgr.HidePanel<UI_GraphicRextualPanel>();
|
|
GameManager.UIMgr.HidePanel<UI_BGPanel>();
|
|
GameObject SplitCamera = GameObject.Find("SplitCamera");
|
|
|
|
foreach (Transform item in SplitCamera.transform)
|
|
{
|
|
item.gameObject.SetActive(false);
|
|
}
|
|
//LiveSceneManger.Instance.TipBtn.gameObject.SetActive(true);
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|