Skip to content

Commit c4e8437

Browse files
committed
2 parents 62fbb37 + 723bd2f commit c4e8437

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# 1 Description
2+
`MonoAlphaModifier` lets you control the transparency of various objects, including sprites and particle systems. Its logic is similar to Unity's `CanvasGroup`: it allows you to adjust the alpha value for a group of objects simultaneously, simplifying the management of visual effects.
3+
4+
- Controls the transparency of multiple objects within the `MonoAlphaModifier`.
5+
- Supports nested objects with `MonoAlphaModifier` and combines their alpha values for child objects.
6+
7+
# 2 How to Use
8+
## 2.1 UnityEditor
9+
Add the MonoAlphaModifier component to an object.
10+
11+
Choose one of the two options in the component's context menu:
12+
13+
`Alpha for this Object` - controls the transparency only for the current object.
14+
15+
`Alpha for this Branch` - controls the transparency for the current object and all its child objects.
16+
17+
## 2.2 Scripts
18+
To control transparency, use the `Alpha` property of the `MonoAlphaModifier` component.
19+
20+
To add a new `MonoAlphaModifier` object to the existing hierarchy at runtime, use the methods `FindParent()` or `SetParent(MonoAlphaModifier parent)`.
21+
22+
To remove an object from the hierarchy, use the `RemoveParent()` method.
23+
24+
25+
# 1. Описание
26+
MonoAlphaModifier позволяет контролировать прозрачность различных объектов, включая спрайты и системы частиц. Его логика схожа с `CanvasGroup` в Unity: он позволяет изменять альфа-значение для группы объектов одновременно, что упрощает управление визуальными эффектами.
27+
28+
- Позволяет управлять прозрачностью сразу нескольких объектов, которые находятся внутри `MonoAlphaModifier`.
29+
- Поддерживает вложенные объекты с `MonoAlphaModifier` и комбинирует их альфа-значения для дочерних объектов.
30+
31+
# 2. Как использовать.
32+
## 2.1 UnityEditor
33+
34+
1. Добавить компонент `MonoAlphaModifier` на объект
35+
2. Выбрать одну из двух опций в контекстном меню компонента
36+
2.1 `Alpha for this Object` - компонент будет контролировать прозрачность только для текущего объекта, к которому прикреплён
37+
2.2 `Alpha for this Branch` - компонент будет контролировать прозрачность для текущего и всех дочерних объектов.
38+
39+
## 2.2 Scripts
40+
41+
Для управления прозрачностью используйте свойство `Alpha` компонента `MonoAlphaModifier`.
42+
43+
Если во время выполнения необходимо добавить новый объект `MonoAlphaModifier` в существующую иерархию, используйте методы `FindParent()` или `SetParent(MonoAlphaModifier parent)`.
44+
45+
Для удаления объекта из иерархии используйте метод `RemoveParent()`.

0 commit comments

Comments
 (0)