Class LogUIHandler
Inheritance
object
LogUIHandler
Namespace: AS2.UI
Assembly: .dll
Syntax
public class LogUIHandler : MonoBehaviour
Fields
|
Edit this page
View Source
color_debug
Declaration
Field Value
|
Edit this page
View Source
color_error
Declaration
Field Value
|
Edit this page
View Source
color_log
Declaration
Field Value
|
Edit this page
View Source
color_warning
Declaration
public Color color_warning
Field Value
|
Edit this page
View Source
go_elementParent
Declaration
public GameObject go_elementParent
Field Value
Type |
Description |
GameObject |
|
|
Edit this page
View Source
go_expand
Declaration
public GameObject go_expand
Field Value
Type |
Description |
GameObject |
|
|
Edit this page
View Source
go_log
Declaration
Field Value
Type |
Description |
GameObject |
|
|
Edit this page
View Source
instance
Declaration
public static LogUIHandler instance
Field Value
|
Edit this page
View Source
keepVisible
Declaration
Field Value
|
Edit this page
View Source
logElementList
Declaration
public List<GameObject> logElementList
Field Value
Type |
Description |
List<GameObject> |
|
|
Edit this page
View Source
logEntryID
Declaration
Field Value
|
Edit this page
View Source
maxLogEntries
Declaration
private int maxLogEntries
Field Value
|
Edit this page
View Source
Declaration
public ScrollRect scrollRect
Field Value
Type |
Description |
ScrollRect |
|
|
Edit this page
View Source
Declaration
private int scrollToBottomInAmountOfFrames
Field Value
|
Edit this page
View Source
timeVisible
Declaration
private float timeVisible
Field Value
|
Edit this page
View Source
timeVisibleInitial
Declaration
private float timeVisibleInitial
Field Value
|
Edit this page
View Source
timestampLastInteraction
Declaration
private float timestampLastInteraction
Field Value
Methods
|
Edit this page
View Source
AddLogEntry(string, EntryType)
Adds a log entry to the log.
Declaration
public void AddLogEntry(string text, LogUIHandler.EntryType type)
Parameters
Type |
Name |
Description |
string |
text |
The text to log.
|
LogUIHandler.EntryType |
type |
The type of the log entry.
|
|
Edit this page
View Source
AddLogEntry(string, EntryType, bool, bool)
Adds a log entry to the log.
Declaration
protected void AddLogEntry(string text, LogUIHandler.EntryType type, bool showNumberOfEntry, bool useOldPrefab = false)
Parameters
Type |
Name |
Description |
string |
text |
The text to log.
|
LogUIHandler.EntryType |
type |
The type of the log entry.
|
bool |
showNumberOfEntry |
True if the number of the entry should be shown.
|
bool |
useOldPrefab |
True if the old prefab which does not support multiline should be used. Recommendation: Keep this at false.
|
|
Edit this page
View Source
The user pressed the collapse log button. The log might disappear if you treated it nicely.
Declaration
public void ButtonPressed_CollapseLog()
|
Edit this page
View Source
The user pressed the expand log button. I guess this means the log should expand.
Declaration
public void ButtonPressed_ExpandLog()
|
Edit this page
View Source
GetLogElementTMPHeader(GameObject)
Returns the TMP UGUI for the header.
Declaration
private TextMeshProUGUI GetLogElementTMPHeader(GameObject logElement)
Parameters
Type |
Name |
Description |
GameObject |
logElement |
|
Returns
Type |
Description |
TextMeshProUGUI |
|
|
Edit this page
View Source
GetLogElementTMPText(GameObject)
Returns the TMP UGUI for the text.
Declaration
private TextMeshProUGUI GetLogElementTMPText(GameObject logElement)
Parameters
Type |
Name |
Description |
GameObject |
logElement |
|
Returns
Type |
Description |
TextMeshProUGUI |
|
|
Edit this page
View Source
GetLogElementTextMeshProUGUI(GameObject, int)
Returns the first/second/third/etc... found TMP UGUI in the child elements of the log element. Index starting at 1.
Declaration
private TextMeshProUGUI GetLogElementTextMeshProUGUI(GameObject logElement, int firstSecondEtc)
Parameters
Type |
Name |
Description |
GameObject |
logElement |
|
int |
firstSecondEtc |
|
Returns
Type |
Description |
TextMeshProUGUI |
|
|
Edit this page
View Source
Hide()
Declaration
|
Edit this page
View Source
InitLog()
Initializes the log and writes some welcome message.
Declaration
|
Edit this page
View Source
Scrolls to the bottom of the log.
We call this method after some very small number of frames because Unity needs to update some internal UI stuff before the sizes of the UI elements are in the system.
Declaration
public void ScrollToBottom()
|
Edit this page
View Source
Show(bool, bool)
Declaration
public void Show(bool scrollDown, bool keepVisible)
Parameters
Type |
Name |
Description |
bool |
scrollDown |
True if the log should scroll down.
|
bool |
keepVisible |
True if the log should be kept visible, false if it should disappear automatically after some time.
|
|
Edit this page
View Source
Start()
Declaration
|
Edit this page
View Source
Update()
Update loop for the log UI, called each frame.
Declaration