public void Init(FriendUI friend, FriendButtonsUI userButtons, FriendStatusLineUI statusLine, FriendActionsButton actionsButton) { Friend = friend; UserButtons = userButtons; ActionsButton = actionsButton; StatusLine = statusLine; if (StatusLine != null) { StatusLine.ClearMessage(); } if (UserButtons != null) { UserButtons.DisableAll(); InitUserButtons(UserButtons); } if (ActionsButton != null) { ActionsButton.gameObject.SetActive(true); ActionsButton.ClearActions(); InitUserActionsButton(ActionsButton); } InitOtherElements(); }
private void OnDestroy() { ClearActions(); if (_activeButton != null && _activeButton.Equals(this)) { _activeButton = null; } }
private void ToggleActionContainer() { var newActiveValue = !IsActive; actionContainer.gameObject.SetActive(newActiveValue); if (!_activeButton) { _activeButton = this; return; } if (_activeButton.Equals(this)) { return; } if (_activeButton.IsActive) { _activeButton.ToggleActionContainer(); } _activeButton = this; }
protected abstract void InitUserActionsButton(FriendActionsButton actionsButton);