Compare commits
2 Commits
3243c02642
...
b89c3bd230
| Author | SHA1 | Date |
|---|---|---|
|
|
b89c3bd230 | |
|
|
51e99e77ef |
|
|
@ -105,7 +105,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 0
|
||||||
--- !u!224 &3057948792150759128
|
--- !u!224 &3057948792150759128
|
||||||
RectTransform:
|
RectTransform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -423,15 +423,15 @@ MonoBehaviour:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_text: New Text
|
m_text: New Text
|
||||||
m_isRightToLeft: 0
|
m_isRightToLeft: 0
|
||||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
m_fontAsset: {fileID: 11400000, guid: f8ef5cb2ab4d4da4093d3fe60f978c99, type: 2}
|
||||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
m_sharedMaterial: {fileID: -4829118149068189727, guid: f8ef5cb2ab4d4da4093d3fe60f978c99, type: 2}
|
||||||
m_fontSharedMaterials: []
|
m_fontSharedMaterials: []
|
||||||
m_fontMaterial: {fileID: 0}
|
m_fontMaterial: {fileID: 0}
|
||||||
m_fontMaterials: []
|
m_fontMaterials: []
|
||||||
m_fontColor32:
|
m_fontColor32:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
rgba: 4278190080
|
rgba: 4294967295
|
||||||
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
|
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_enableVertexGradient: 0
|
m_enableVertexGradient: 0
|
||||||
m_colorMode: 3
|
m_colorMode: 3
|
||||||
m_fontColorGradient:
|
m_fontColorGradient:
|
||||||
|
|
@ -613,8 +613,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: 194}
|
m_AnchoredPosition: {x: 0, y: 36}
|
||||||
m_SizeDelta: {x: 200, y: 50}
|
m_SizeDelta: {x: 200, y: 400}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!222 &1947538143585023095
|
--- !u!222 &1947538143585023095
|
||||||
CanvasRenderer:
|
CanvasRenderer:
|
||||||
|
|
@ -644,17 +644,19 @@ MonoBehaviour:
|
||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_text: New Text
|
m_text: 'New Text
|
||||||
|
|
||||||
|
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
|
||||||
m_isRightToLeft: 0
|
m_isRightToLeft: 0
|
||||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
m_fontAsset: {fileID: 11400000, guid: 1c4004df1d65ff944b6e23e3af757df7, type: 2}
|
||||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
m_sharedMaterial: {fileID: 1751944718996602668, guid: 1c4004df1d65ff944b6e23e3af757df7, type: 2}
|
||||||
m_fontSharedMaterials: []
|
m_fontSharedMaterials: []
|
||||||
m_fontMaterial: {fileID: 0}
|
m_fontMaterial: {fileID: 0}
|
||||||
m_fontMaterials: []
|
m_fontMaterials: []
|
||||||
m_fontColor32:
|
m_fontColor32:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
rgba: 4278190080
|
rgba: 4294967295
|
||||||
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
|
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
m_enableVertexGradient: 0
|
m_enableVertexGradient: 0
|
||||||
m_colorMode: 3
|
m_colorMode: 3
|
||||||
m_fontColorGradient:
|
m_fontColorGradient:
|
||||||
|
|
@ -671,15 +673,15 @@ MonoBehaviour:
|
||||||
m_faceColor:
|
m_faceColor:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
rgba: 4294967295
|
rgba: 4294967295
|
||||||
m_fontSize: 36
|
m_fontSize: 20
|
||||||
m_fontSizeBase: 36
|
m_fontSizeBase: 20
|
||||||
m_fontWeight: 400
|
m_fontWeight: 400
|
||||||
m_enableAutoSizing: 0
|
m_enableAutoSizing: 0
|
||||||
m_fontSizeMin: 18
|
m_fontSizeMin: 18
|
||||||
m_fontSizeMax: 72
|
m_fontSizeMax: 72
|
||||||
m_fontStyle: 0
|
m_fontStyle: 0
|
||||||
m_HorizontalAlignment: 2
|
m_HorizontalAlignment: 1
|
||||||
m_VerticalAlignment: 512
|
m_VerticalAlignment: 256
|
||||||
m_textAlignment: 65535
|
m_textAlignment: 65535
|
||||||
m_characterSpacing: 0
|
m_characterSpacing: 0
|
||||||
m_wordSpacing: 0
|
m_wordSpacing: 0
|
||||||
|
|
@ -725,7 +727,7 @@ GameObject:
|
||||||
- component: {fileID: 8605807043960739410}
|
- component: {fileID: 8605807043960739410}
|
||||||
- component: {fileID: 8271235842251393859}
|
- component: {fileID: 8271235842251393859}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: Image (1)
|
m_Name: Image_Left
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
|
|
@ -1003,7 +1005,7 @@ GameObject:
|
||||||
- component: {fileID: 3100583911508305969}
|
- component: {fileID: 3100583911508305969}
|
||||||
- component: {fileID: 54904237984238409}
|
- component: {fileID: 54904237984238409}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: Image (2)
|
m_Name: Image_Right
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
|
|
|
||||||
|
|
@ -47,13 +47,13 @@ public class SorghumController : PermanentTriggerBase
|
||||||
{
|
{
|
||||||
targetHD.SetActive(true);
|
targetHD.SetActive(true);
|
||||||
targetSD.SetActive(false);
|
targetSD.SetActive(false);
|
||||||
GameManager.UIMgr.ShowPanel<UI_GraphicRextualPanel>();
|
GameManager.UIMgr.ShowPanel<UI_GraphicRextualPanel>(E_UI_Layer.Mid, (p) => { p.Init(); });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
targetHD.SetActive(false);
|
targetHD.SetActive(false);
|
||||||
targetSD.SetActive(true);
|
targetSD.SetActive(true);
|
||||||
GameManager.UIMgr.ShowPanel<UI_GraphicRextualPanel>();
|
GameManager.UIMgr.ShowPanel<UI_GraphicRextualPanel>(E_UI_Layer.Mid, (p) => { p.Init(); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,23 @@ using UnityEngine;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class allPlants
|
public class plantPart
|
||||||
{
|
{
|
||||||
public class plantPart
|
public string partName;
|
||||||
{
|
public string partIntro;
|
||||||
public string partName;
|
}
|
||||||
public string partIntro;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public class allPlant
|
||||||
|
{
|
||||||
public string plantName;
|
public string plantName;
|
||||||
public List<plantPart> plantParts;
|
public List<plantPart> plantParts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class plantsInfo
|
||||||
|
{
|
||||||
|
public List<allPlant> allPlants;
|
||||||
|
}
|
||||||
|
|
||||||
public class UI_GraphicRextualPanel : BasePanel
|
public class UI_GraphicRextualPanel : BasePanel
|
||||||
{
|
{
|
||||||
public RawImage rawImage;
|
public RawImage rawImage;
|
||||||
|
|
@ -27,11 +32,38 @@ public class UI_GraphicRextualPanel : BasePanel
|
||||||
//ÄÚÈÝ
|
//ÄÚÈÝ
|
||||||
public TextMeshProUGUI ContentTextMeshProUGUI;
|
public TextMeshProUGUI ContentTextMeshProUGUI;
|
||||||
|
|
||||||
public allPlants allPlants;
|
//public RawImageScript rawImageScript_Left;
|
||||||
|
//public RawImageScript rawImageScript_Right;
|
||||||
|
|
||||||
|
public plantsInfo plantsInfo;
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
allPlants = JsonManager.Instance.LoadData<allPlants>("plantsInfo");
|
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()
|
protected override void Awake()
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ public class RawImageScript : MonoBehaviour, IPointerEnterHandler, IPointerExitH
|
||||||
if (_highlight != null)
|
if (_highlight != null)
|
||||||
{
|
{
|
||||||
_highlight.SetHighlighted(true);
|
_highlight.SetHighlighted(true);
|
||||||
|
rextualPanel.showPlantPartOnRawImage(hit.collider.gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue