Click or drag to resize

Com.ForbiddenByte.OSA.Demos.MultiplePrefabs Namespace

 
Classes
  ClassDescription
Public classMultiplePrefabsExample

Example implementation demonstrating the use of 2 different views holders, representing 2 different models into their own prefab, with a common Title property, displayed in a Text found on both prefabs.

The only constrain is for the models to have a common ancestor class and for the views holders to also have a common ancestor class

Also, the BidirectionalModel is used to demonstrate how the data can flow from the model to the views, but also from the views to the model (i.e. this model updates when the user changes the value of its corresponding slider)

At the core, everything's the same as in other example implementations, so if something's not clear, check them (SimpleExample is a good start)

Public classMultiplePrefabsSceneEntry
Hookup between the DrawerCommandPanel and the adapter to isolate example code from demo-ing and navigation code
Public classMyParams
Contains the 2 prefabs associated with the 2 views holders and the data list containing models of the 2 type, stored as BaseModel
Public classSliderItemBehaviour

Basic behavior used on items related to BidirectionalVH and BidirectionalModel to demonstrate the bidirectional flow of data (i.e. form model to the view and vice-versa)

It fires its ValueChanged when the slider's value changes and displays it in a Text component. The slider's value can also be changed/retrieved via the Value property