Skip to content

Code rework4#29

Open
Zlobik wants to merge 3 commits into
HolyMonkey:masterfrom
Zlobik:CodeRework4
Open

Code rework4#29
Zlobik wants to merge 3 commits into
HolyMonkey:masterfrom
Zlobik:CodeRework4

Conversation

@Zlobik
Copy link
Copy Markdown

@Zlobik Zlobik commented Jan 21, 2021

No description provided.

Comment thread Assets/Scripts/Enemy.cs
public class Enemy : MonoBehaviour
{
[SerializeField] private float _speed = 2;
[SerializeField] private float _targetSpreed = 4;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_movementRadius

Comment thread Assets/Scripts/Player.cs
Comment on lines +15 to +17
for (int i = 0; i < _enemiesContainer.childCount; i++)
{
if (_enemiesContainer.GetChild(i).gameObject.GetComponent<Enemy>())
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetComponentsInChildren

Comment thread Assets/Scripts/Player.cs
{
if(collision.TryGetComponent(out Enemy enemy))
{
KilledEnemys++;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_enemiesOnLevel--

using System.Collections.Generic;
using UnityEngine;

public class EnemyBooster : Enemy
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не нужно наследоваться от Enemy или придумай Enemy другое название

Comment on lines +25 to +26
_boosterForce = enemyBooster.BoosterForce;
_boosterTime = enemyBooster.BoosterTime;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это должно передаваться в метод через параметры

private void Update ()
{
_moveDirection = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0);
transform.position = transform.position + _moveDirection * _speed * Time.deltaTime;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transform.Translate

public class PlayerMover : MonoBehaviour
{
[SerializeField] private float _speed;
[SerializeField] private float _addBoostingForceStep = 3f;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это используется?

{
[SerializeField] private float _speed;
[SerializeField] private float _addBoostingForceStep = 3f;
[SerializeField] private float _boostingWaitForSeconds = 0.15f;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это используется?


private float _boosterTime = 0;
private float _boosterForce = 0;
private float _speedWithoutBoosters;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_baseSpeed


private void Update ()
{
_moveDirection = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему направление полем?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants