/
TON618OFF
/
Unity-Project-RTU
Обзор
Документация
Войти
/
TON618OFF
/
Unity-Project-RTU
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Library/PackageCache/com.unity.testtools.codecoverage@1.2.6/Samples~/Tutorial/Asteroids/Scripts/Weapons/ProjectileController.cs
30 строк
633 B
TON618OFF
release
03 окт 2024, 22:20
03 окт 2024, 22:20
7c70e9f
Код
Авторство
О чём код?
using UnityEngine; public class ProjectileController : BaseProjectile { private Vector2 direction = Vector2.right; private void Update() { if (!GameManager.IsPaused) Move(); } public void Move() { transform.position += (Vector3)direction * Time.deltaTime * 16; transform.up = direction; if (Vector2.Distance(transform.position, Vector2.zero) > 20.0f) DestroyImmediate(gameObject); } public void SetDirection(Vector2 value) { direction = value; } public Vector2 GetDirection() { return direction; } }