Skip to content

Commit

Permalink
Update README and CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
LanKuDot committed Jan 10, 2024
1 parent 714fe71 commit 3108cd3
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CircularScrollingList/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

### [CircularList_v6.2] - 2023.05.17

**Added**

- Add `OnBoxMoved` to `ListBox`

### [CircularList_v6.1] - 2023.04.06

**Added**
Expand Down
46 changes: 44 additions & 2 deletions CircularScrollingList/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ The quick overview of version 6 - [Demo video](https://youtu.be/6y-_MaeWIAg)
- [Custom `ListBox`](#custom-listbox)
- [Use Them in the List](#use-them-in-the-list)
- [Pass Data of Primitive Type](#pass-data-of-primitive-type)
- [Events](#events)
- [List Events](#list-events-1)
- [`OnBoxSelected` Event](#onboxselected-event)
- [`OnFocusingBoxChanged` Event](#onfocusingboxchanged-event)
- [Manually Get the Focusing Box](#manually-get-the-focusing-box)
- [`OnMovementEnd` event](#onmovementend-event)
- [Box Events](#box-events)
- [`OnInitialized` event](#oninitialized-event)
- [`OnBoxMoved` event](#onboxmoved-event)
- [Script Operations](#script-operations)
- [Late Initialization](#late-initialization)
- [Toggle List Interaction](#toggle-list-interaction)
Expand Down Expand Up @@ -435,7 +438,7 @@ public class StringListBox : ListBox
}
```

## Events
## List Events

*Related demo scene: 06-ListEvents*

Expand Down Expand Up @@ -573,6 +576,45 @@ If the "Focusing Position" is set to **Bottom**, then it will be like (ReadmeDat

`OnMovementEnd` event will be invoked when the list stops moving.

## Box Events

The `ListBox.cs` provides some event callbacks. You could define custom behaviour by overriding these event callbacks.

### `OnInitialized` event

`OnInitialized` event is invoked when the list is initialized (`CircularScrollingList.Initialize()`).

```csharp
public class MyListBox : ListBox
{
protected override void OnInitialized()
{
...
}
}
```

### `OnBoxMoved` event

`OnBoxMoved` event is invoked when the box is moving. In addition, when the box is initialized.

The event has 1 parameter `positionRatio` which is from -1 to 1.

```csharp
public class MyListBox : ListBox
{
[SerializedField]
private Image _image;

public override void OnBoxMoved(float positionRatio)
{
var color = _image.color;
color.a = 1 - Mathf.Abs(positionRatio);
_image.color = color;
}
}
```

## Script Operations

### Late Initialization
Expand Down
Binary file modified CircularScrollingList/README.pdf
Binary file not shown.

0 comments on commit 3108cd3

Please sign in to comment.