Class MsgPanelPresenter
Controls the presentation and animation of the message panel UI. This component is responsible for displaying messages, handling notification indicators, and managing smooth open/close animations using DOTween. It also exposes methods to instantiate message presenters, integrate with pooling, and handle message expiration behavior.
public class MsgPanelPresenter : MonoBehaviour
Inheritance
Extension Methods
EntryResponserUtility.ObjectPoolFactory(MsgPanelPresenter, MsgPresenter, int, int)
Methods
AddMessageFromPool(MsgPresenter)
Adds an existing message presenter instance to the panel and prepares it for display.
public MsgPresenter AddMessageFromPool(MsgPresenter msg)
Parameters
| Name | Type | Description |
|---|---|---|
msg | MsgPresenter | The message presenter to add. |
Returns
MsgPresenter — The prepared MsgPresenter.
ClosePanel()
Closes the panel, playing the closing animation or instantly hiding it if animations are skipped.
public void ClosePanel()
DestoryMessage(MsgPresenter)
Destroys/removes a message.
public void DestoryMessage(MsgPresenter msg)
Parameters
| Name | Type | Description |
|---|---|---|
msg | MsgPresenter | The message to destroy. |
InstantiateMessage(MsgPresenter)
Instantiates a new message prefab and adds it to the panel content.
public MsgPresenter InstantiateMessage(MsgPresenter Prefab)
Parameters
| Name | Type | Description |
|---|---|---|
Prefab | MsgPresenter | The message presenter prefab to instantiate. |
Returns
MsgPresenter — The instantiated MsgPresenter.
OpenPanel()
Opens the panel, playing the opening animation or instantly showing it if animations are skipped.
public void OpenPanel()
ReleaseMessage(MsgPresenter)
Releases a message back to its pool (disabling its GameObject).
public void ReleaseMessage(MsgPresenter msg)
Parameters
| Name | Type | Description |
|---|---|---|
msg | MsgPresenter | The message to release. |