/
RealMotya
/
Platformer
Обзор
Документация
Войти
/
RealMotya
/
Platformer
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Assets/Array1.cs
50 строк
1 KB
VR4\IT-Cube28
добавил мерцание
20 ноя 2025, 11:43
20 ноя 2025, 11:43
22041d6
Код
Авторство
О чём код?
using UnityEngine; public class Array1 : MonoBehaviour { public GameObject[] myarray; //private int[,] mas = new int[,] { { 1, 3, 5, 8 }, { 34, 67, 42, 52 } }; void Start() { for ( int i = 0; i < myarray.GetLength(0); i++) { myarray[i].GetComponent<SpriteRenderer>().color = Color.red; } for (int i = myarray.Length - 1; i >= 0; i--) { myarray[i].GetComponent<SpriteRenderer>().color = Color.blue; myarray[i].transform.localScale = new Vector2(2, 2); //myarray[i].transform.position = new Vector2(-1.46f, 0); } int b = 0; while (b < myarray.Length) { myarray[b].transform.Rotate(0, 0, 45f); b++; } b = 0; do { myarray[b].GetComponent<SpriteRenderer>().color = Random.ColorHSV(); b++; } while (b < myarray.Length); foreach (var figure in myarray) { figure.transform.localScale = new Vector2(0.5f, 1f); } } void Update() { } }