DiscoverTenerife
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
adaptableSizePanel Class Referenceabstract

abstract class that represent an adaptable vertical size panel. It provides methods for control the height of the panel depending of the number of prefabs that it has attached. Classes that inherit from this class must have a fillPanel method. More...

Inheritance diagram for adaptableSizePanel:
RangeStoryPanel SearchAFriendToChallengePanel challengesPanelController chooseAPlaceToSendAsAChallengePanel friendsPanel newFriendInvitationPanel rankingPanel

Public Member Functions

virtual void elementDeleted (GameObject elementDeleted)
 tries to remove the given gameobject of the items property. If the gameobject isnt on the list, it will raise an index out of range exception. More...
 

Protected Member Functions

abstract void fillPanel ()
 This method is called to instanciate the panel and add the prefabs as panels elements. It is an abstract method so, every class that inherit from this class must have its own fillPanel method. More...
 
void adjustPanelSize ()
 

Protected Attributes

GameObject prefab_
 GameObject that contains the prefab that represent an element of the panel. More...
 
GameObject noItemsImage_
 GameObject that contains the image that will be shown when the panel is empty. More...
 
bool panelFilled_
 if its true means that the panel was already filled, false in otherwhise. More...
 
List< GameObject > items_
 List of the prefabs that are instanciated. More...
 
int lastCount_
 it stores the last quantity of items which the panel has adapted its height. More...
 
float initialHeight_
 initial height of the panel. More...
 

Private Member Functions

void Awake ()
 
void Update ()
 

Detailed Description

abstract class that represent an adaptable vertical size panel. It provides methods for control the height of the panel depending of the number of prefabs that it has attached. Classes that inherit from this class must have a fillPanel method.

Member Function Documentation

◆ adjustPanelSize()

void adaptableSizePanel.adjustPanelSize ( )
protected

This method should be called each time that the panel adds or quits an element. This method adjust the height of the panel to keep the apparence when the number of elements changes.

◆ Awake()

void adaptableSizePanel.Awake ( )
private

This method is called before the first frame, it instanciate the items, panelFilled_ and lastCount_ properties. And if the userDataIsReady method of firebaseHandler class returns true it calls the fillPanel method.

◆ elementDeleted()

virtual void adaptableSizePanel.elementDeleted ( GameObject  elementDeleted)
virtual

tries to remove the given gameobject of the items property. If the gameobject isnt on the list, it will raise an index out of range exception.

Parameters
GameObjectthat contains the prefab element that has been deleted.

Reimplemented in chooseAPlaceToSendAsAChallengePanel.

◆ fillPanel()

abstract void adaptableSizePanel.fillPanel ( )
protectedpure virtual

This method is called to instanciate the panel and add the prefabs as panels elements. It is an abstract method so, every class that inherit from this class must have its own fillPanel method.

Implemented in challengesPanelController, chooseAPlaceToSendAsAChallengePanel, newFriendInvitationPanel, friendsPanel, RangeStoryPanel, rankingPanel, and SearchAFriendToChallengePanel.

◆ Update()

void adaptableSizePanel.Update ( )
private

This method is called once per frame, it checks if the panel has al ready filled and if the userDataIsReady method of firebaseHandler class returns true it calls the fillPanel method. If the lastCount_ property isnt equal to the current items count it calls the adjustPanelSize method. It also shows the noPlacesImage_ gameObject if the items list is empty.

Member Data Documentation

◆ initialHeight_

float adaptableSizePanel.initialHeight_
protected

initial height of the panel.

◆ items_

List<GameObject> adaptableSizePanel.items_
protected

List of the prefabs that are instanciated.

◆ lastCount_

int adaptableSizePanel.lastCount_
protected

it stores the last quantity of items which the panel has adapted its height.

◆ noItemsImage_

GameObject adaptableSizePanel.noItemsImage_
protected

GameObject that contains the image that will be shown when the panel is empty.

◆ panelFilled_

bool adaptableSizePanel.panelFilled_
protected

if its true means that the panel was already filled, false in otherwhise.

◆ prefab_

GameObject adaptableSizePanel.prefab_
protected

GameObject that contains the prefab that represent an element of the panel.


The documentation for this class was generated from the following file: