extensions.unity.osa
v1.0.2
Published
Extensions for Unity's OSA (Optimized ScrollView Adapter) package.
Downloads
24
Readme
Unity OSA Extensions
Extensions for Unity's OSA (Optimized ScrollView Adapter) package.
Installation
- Install OpenUPM-CLI
- Open command line in Unity project folder
- Run the command
openupm --registry https://registry.npmjs.com add extensions.unity.osa
Usage
- To make an adapter extend from the base classes:
BaseAdapterGrid
orBaseAdapterList
. - Create ViewController class by extending from
ViewController
.
using Extensions.Unity.OSA.Adapter;
public class AdapterStoriesGrid : BaseAdapterGrid<ViewControllerStory, DataStory>
{
}
using Extensions.Unity.OSA.Adapter;
public class AdapterStoriesList : BaseAdapterList<ViewControllerStory, DataStory>
{
}
using Extensions.Unity.OSA.View;
using UnityEngine;
using UnityEngine.UI;
public class ViewControllerStory : ViewController<DataStory>
{
[SerializeField] Text txtTitle;
[SerializeField] Text txtDescription;
public override void SetData(DataStory model)
{
txtTitle.text = model.title;
txtDescription.text = model.description;
}
}
public class DataStory
{
public string title;
public string description;
}