Skip to content

Refactoring Code#40

Open
Dirofu wants to merge 1 commit into
HolyMonkey:masterfrom
Dirofu:Game
Open

Refactoring Code#40
Dirofu wants to merge 1 commit into
HolyMonkey:masterfrom
Dirofu:Game

Conversation

@Dirofu
Copy link
Copy Markdown

@Dirofu Dirofu commented May 13, 2021

No description provided.

@Dirofu Dirofu changed the title Init Refactoring Code May 13, 2021
using System.Collections.Generic;
using UnityEngine;

public class EndGame : MonoBehaviour
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.

Название не отражает суть

Comment on lines +18 to +24
private void Update()
{
if (_countEnemy == 0)
{
End();
}
}
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.

Подумай ещё раз

_endScreen.SetActive(true);
}

public void DestroyEnemy(GameObject 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.

Причём тут EndGame условный и метод удаления противника?

public class Enemy : MonoBehaviour
{
private Vector3 _target;
private float _timeToSwitchDirection = 2f;
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 Vector3 _target;
private float _timeToSwitchDirection = 2f;
private int _unitMultiplier = 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.

??
А что не просто number?


private void Start()
{
_target = Random.insideUnitCircle * _unitMultiplier;
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.

Дубляж кода

using System.Collections;
using UnityEngine;

public class Player : MonoBehaviour
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