You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Скрипт для создания бесконечно прокручивающегося фона на Unity с эффектом параллакса из [статьи](https://suvitruf.ru/2019/12/23/7150/platformer-unity-background-parallax/).
3
+
4
+
## Использование
5
+
Вся магия в скрипте [ParallaxScript.cs](https://github.com/Suvitruf/unity-parallax/blob/master/Assets/Scripts/ParallaxScript.cs).
6
+
7
+
Для начала вам нужно добавить на сцену 3 копии фона с отступами.
У вложенных объектов нужно выставить по координате X оффсет на размер спрайта. У одного с плюсом, а другого с минусом. В итоге корневой элемент будет по центру, а два вложенных по бокам.
Script for creating 2d infinite scrolling background in Unity with parallax effect from [the article](https://suvitruf.ru/2019/12/23/7150/platformer-unity-background-parallax/).
3
+
4
+
## Usage
5
+
All magic in the script [ParallaxScript.cs](https://github.com/Suvitruf/unity-parallax/blob/master/Assets/Scripts/ParallaxScript.cs).
6
+
7
+
First you need to add 3 copies of background with offset.
Nested objects should have offset by X axes. One with negative offset and one with positive. As a result root element will be in the middle, and 2 nested elements on the sides.
0 commit comments