【剧情】剧情选项功能完善
parent
a4a15217be
commit
8620bf4f4d
|
|
@ -967,10 +967,10 @@ RectTransform:
|
|||
- {fileID: 5916533254666486216}
|
||||
m_Father: {fileID: 7896991221781629267}
|
||||
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_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 2400, y: 500}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7354507930124901987
|
||||
CanvasRenderer:
|
||||
|
|
@ -1562,6 +1562,7 @@ GameObject:
|
|||
- component: {fileID: 2683184536228266820}
|
||||
- component: {fileID: 3064266348412709766}
|
||||
- component: {fileID: 5735725635321830867}
|
||||
- component: {fileID: 8407144730458971829}
|
||||
m_Layer: 5
|
||||
m_Name: Button_PlotChoose
|
||||
m_TagString: Untagged
|
||||
|
|
@ -1586,9 +1587,9 @@ RectTransform:
|
|||
- {fileID: 7077961136597025946}
|
||||
m_Father: {fileID: 5026670337134287458}
|
||||
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: 155}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 960, y: -385}
|
||||
m_SizeDelta: {x: 2400, y: 104}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2683184536228266820
|
||||
|
|
@ -1673,6 +1674,18 @@ MonoBehaviour:
|
|||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &8407144730458971829
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1469998538090762700}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 92a780f4c13b41a488ae0e00b8b05bff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1475585034609502626
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -3854,9 +3867,9 @@ RectTransform:
|
|||
m_Children: []
|
||||
m_Father: {fileID: 732582585202546851}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 1, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 250}
|
||||
m_SizeDelta: {x: 0, y: 500}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!1 &4240712920925990597
|
||||
|
|
@ -3974,7 +3987,7 @@ RectTransform:
|
|||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -480, y: 580}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &366593706780149855
|
||||
CanvasRenderer:
|
||||
|
|
@ -5110,7 +5123,8 @@ GameObject:
|
|||
- component: {fileID: 5916533254666486216}
|
||||
- component: {fileID: 7398328029246828841}
|
||||
- component: {fileID: 899524176963776767}
|
||||
- component: {fileID: 8900813394353423888}
|
||||
- component: {fileID: 1999560166320842557}
|
||||
- component: {fileID: 9130658860417941557}
|
||||
m_Layer: 5
|
||||
m_Name: ScrollView
|
||||
m_TagString: Untagged
|
||||
|
|
@ -5176,7 +5190,7 @@ MonoBehaviour:
|
|||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &8900813394353423888
|
||||
--- !u!114 &1999560166320842557
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
|
|
@ -5185,12 +5199,12 @@ MonoBehaviour:
|
|||
m_GameObject: {fileID: 5817110954416769547}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9f9de67925f950347af7cb5c19023db8, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Content: {fileID: 9144202120907689090}
|
||||
m_Horizontal: 0
|
||||
m_Vertical: 1
|
||||
m_Vertical: 0
|
||||
m_MovementType: 1
|
||||
m_Elasticity: 0.1
|
||||
m_Inertia: 1
|
||||
|
|
@ -5206,10 +5220,32 @@ MonoBehaviour:
|
|||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
defaultItemSize: {x: 2400, y: 158}
|
||||
itemTemplate: {fileID: 6704486385912363507}
|
||||
layoutType: 1
|
||||
poolSize: 5
|
||||
--- !u!114 &9130658860417941557
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5817110954416769547}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2afdea96f23d9c24daa7ca2362138277, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
firstArrow: {fileID: 0}
|
||||
endArrow: {fileID: 0}
|
||||
dir: 1
|
||||
isSort: 0
|
||||
isAutoSetDrag: 0
|
||||
isShowArrow: 0
|
||||
lines: 1
|
||||
squareSpacing: 5
|
||||
cell: {fileID: 1469998538090762700}
|
||||
Spacing: {x: 0, y: 40}
|
||||
row: 0
|
||||
col: 0
|
||||
paddingTop: 17
|
||||
paddingLeft: 0
|
||||
--- !u!1 &5884927361845391357
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -6812,7 +6848,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &9012499805869355045
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -7083,7 +7119,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7896991221781629267
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ using Gameplay.Story.Cmp.Timeline.UIModChangeAction;
|
|||
using PhxhSDK;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.Timeline;
|
||||
using UnityEngine.UI;
|
||||
using Utils;
|
||||
|
|
@ -60,7 +61,7 @@ public class UIStoryMainController : UIWindow
|
|||
|
||||
///Auto Gen End///
|
||||
|
||||
private PhxhScrollView _scroll;
|
||||
private RecycleView _scroll;
|
||||
private GameObject _uiSelectGo;
|
||||
private GameObject _goTalkLog; //剧情记录页面
|
||||
private GameObject _goBubble; //气泡框
|
||||
|
|
@ -120,7 +121,7 @@ public class UIStoryMainController : UIWindow
|
|||
{
|
||||
//bind UI GameObj
|
||||
UIStoryMainBinder.GetComponents(this);
|
||||
_scroll = GetComponent<PhxhScrollView>("UISelect/ImageSelect/ScrollView");
|
||||
_scroll = GetComponent<RecycleView>("UISelect/ImageSelect/ScrollView");
|
||||
_uiSelectGo = FindObj("UISelect");
|
||||
_goTalkLog = FindObj("GoTalkLog");
|
||||
_goBubble = FindObj("Image_TalkBubble");
|
||||
|
|
@ -148,6 +149,7 @@ public class UIStoryMainController : UIWindow
|
|||
|
||||
BindButtons();
|
||||
StoryManager.instance.uiManager.LoadUIMainStory(this);
|
||||
_scroll.Init(RefreshItem);
|
||||
_RegisterEvents();
|
||||
}
|
||||
|
||||
|
|
@ -474,37 +476,47 @@ public class UIStoryMainController : UIWindow
|
|||
}
|
||||
private void CreateScrollView()
|
||||
{
|
||||
if (_scroll)
|
||||
{
|
||||
var go = CommonUtils.GetGameObject(_scroll.gameObject, "Viewport/Content");
|
||||
CommonUtils.DestoryAllChildGameObject(go);
|
||||
}
|
||||
// if (_scroll)
|
||||
// {
|
||||
// var go = CommonUtils.GetGameObject(_scroll.gameObject, "Viewport/Content");
|
||||
// CommonUtils.DestoryAllChildGameObject(go);
|
||||
// }
|
||||
|
||||
RefreshScrollView();
|
||||
}
|
||||
|
||||
private void RefreshScrollView()
|
||||
{
|
||||
_scroll.SetUpdateFunc(RefreshItem);
|
||||
_scroll.SetItemCountFunc(GetCountFunc);
|
||||
_scroll.UpdateData(false);
|
||||
_scroll.SetButton(SetItemClick);
|
||||
_scroll.ShowList(_openData.choiceMsgs.Count);
|
||||
// _scroll.SetUpdateFunc(RefreshItem);
|
||||
// _scroll.SetItemCountFunc(GetCountFunc);
|
||||
// _scroll.UpdateData(false);
|
||||
// _scroll.SetButton(SetItemClick);
|
||||
}
|
||||
|
||||
private void RefreshItem(int idx, RectTransform item)
|
||||
private void RefreshItem(GameObject go, int idx)
|
||||
{
|
||||
var data = _openData.choiceMsgs[idx];
|
||||
var go = item.gameObject;
|
||||
go.SetActive(true);
|
||||
|
||||
var txt = CommonUtils.GetComponent<TMP_Text>(go, "TextContent");
|
||||
var txt = CommonUtils.GetComponent<TMP_Text>(go, "Text_ChooseContent");
|
||||
var button = go.GetComponent<Button>();
|
||||
var buttonEx = go.GetComponent<ButtonEx>();
|
||||
var selectImgGo = CommonUtils.GetGameObject(go, "Image_ChooseOrangeBg");
|
||||
txt.text = data;
|
||||
|
||||
if (button)
|
||||
{
|
||||
ClearBind(button);
|
||||
BindButton(button, OnClickItem, idx);
|
||||
buttonEx.AddPointerDown(data =>
|
||||
{
|
||||
selectImgGo.SetActive(true);
|
||||
});
|
||||
buttonEx.AddPointerUp(data =>
|
||||
{
|
||||
selectImgGo.SetActive(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue