In Game Input Screen
Implemented saving/loading of custom input settings Incorporated Input Screen in game Organized UI scripts into folders Deleted some unused UI scripts Reimplemented Fog Blur (by copying modified DoF to assets)
This commit is contained in:
parent
d47c32dfcf
commit
81acaf2a47
173 changed files with 8236 additions and 7329 deletions
40
Assets/Scripts/UI/Menu/SpreadsheetRow.cs
Normal file
40
Assets/Scripts/UI/Menu/SpreadsheetRow.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UniRx.Triggers;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class SpreadsheetRow : MonoBehaviour
|
||||
{
|
||||
public Prototype Column;
|
||||
public Image Background;
|
||||
public ObservablePointerClickTrigger ClickTrigger;
|
||||
|
||||
private List<RectTransform> _entries = new List<RectTransform>();
|
||||
|
||||
public void ShowData(SpreadsheetEntryRow data)
|
||||
{
|
||||
foreach(var entry in _entries)
|
||||
entry.GetComponent<Prototype>().ReturnToPool();
|
||||
_entries.Clear();
|
||||
|
||||
foreach (var column in data.Columns)
|
||||
{
|
||||
var entry = Column.Instantiate<RectTransform>();
|
||||
entry.GetComponent<TextMeshProUGUI>().text = column.Output();
|
||||
_entries.Add(entry);
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyColumnSizes(int[] sizes)
|
||||
{
|
||||
var distance = 0;
|
||||
for (int i = 0; i < sizes.Length; i++)
|
||||
{
|
||||
_entries[i].anchoredPosition = Vector2.right * distance;
|
||||
_entries[i].sizeDelta = Vector2.right * sizes[i];
|
||||
distance += sizes[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue