Skip to content

Domashka#2

Open
flangedmace wants to merge 3 commits into
mainfrom
moyPerviyPullRequest
Open

Domashka#2
flangedmace wants to merge 3 commits into
mainfrom
moyPerviyPullRequest

Conversation

@flangedmace
Copy link
Copy Markdown
Owner

No description provided.

Comment thread Assets/Scripts/Destroyer.cs Outdated
{
private void OnCollisionEnter2D(Collision2D collision)
{
Debug.Log("Collision");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Это не надо в коде оставлять

Comment thread Assets/Scripts/Destroyer.cs Outdated
using UnityEngine;

[RequireComponent(typeof(Collider2D))]
public class Destroyer : MonoBehaviour
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Што за дестройер? Он к чему относится?

Comment thread Assets/Scripts/Menu/AuthorsPanel.cs Outdated

public void Hide(GameObject panel)
{
_animator.Play("Hiding");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Нельзя использовать строковые литералы так, нужно что-то более стабильное
Хотя бы константы

}

private IEnumerator ClosePanel(GameObject panel)
{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Почему не в начале этой корутины анимация запускается? Зачем было дробить?

using TMPro;
using System;

public class Player : MonoBehaviour
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread Assets/Scripts/Player/JumpState.cs Outdated

[RequireComponent(typeof(Collider2D))]
[RequireComponent(typeof(Rigidbody2D))]
public class JumpState : State
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Плохое решение делать это через программируемые состояния аниматора

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

"программируемые состояния аниматора" - это конечный автомат?

Comment thread Assets/Scripts/Player/Player.cs Outdated
SetCoinsText();
}

private void SetCoinsText()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Методы с глаголом Set должны что-то принимать
Это скорей UpdateText

Comment thread Assets/Scripts/Player/Player.cs Outdated

public class Player : MonoBehaviour
{
[SerializeField] private TextMeshProUGUI _coinstext;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

_coinsText

Comment thread Assets/Scripts/Spawned/Obstacle.cs Outdated
{
if (collision.gameObject.TryGetComponent<Player>(out Player player))
{
SceneManager.LoadScene("Menu");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Попробуй воспользоваться нашим плагином - Typed Scenes

Comment thread Assets/Scripts/Spawned/Spawned.cs Outdated

[RequireComponent(typeof(Collider2D))]
[RequireComponent(typeof(Rigidbody2D))]
public class Spawned : MonoBehaviour
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Spawned?


[SerializeField] private TextMeshProUGUI _coinsText;

private int _coins = 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

приватное поле должно быть выше


public int Coins => _coins;

[SerializeField] private TextMeshProUGUI _coinsText;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

по нашим соглашением приватное поле с этим аттрибутом выше обычрного приватного поля

[SerializeField] protected Transform[] SpawnPoints;
[SerializeField] protected float SpawnInterval;

protected float ElapseTime = 0f;
Copy link
Copy Markdown

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