Domashka#2
Conversation
| { | ||
| private void OnCollisionEnter2D(Collision2D collision) | ||
| { | ||
| Debug.Log("Collision"); |
| using UnityEngine; | ||
|
|
||
| [RequireComponent(typeof(Collider2D))] | ||
| public class Destroyer : MonoBehaviour |
There was a problem hiding this comment.
Што за дестройер? Он к чему относится?
|
|
||
| public void Hide(GameObject panel) | ||
| { | ||
| _animator.Play("Hiding"); |
There was a problem hiding this comment.
Нельзя использовать строковые литералы так, нужно что-то более стабильное
Хотя бы константы
| } | ||
|
|
||
| private IEnumerator ClosePanel(GameObject panel) | ||
| { |
There was a problem hiding this comment.
Почему не в начале этой корутины анимация запускается? Зачем было дробить?
| using TMPro; | ||
| using System; | ||
|
|
||
| public class Player : MonoBehaviour |
There was a problem hiding this comment.
|
|
||
| [RequireComponent(typeof(Collider2D))] | ||
| [RequireComponent(typeof(Rigidbody2D))] | ||
| public class JumpState : State |
There was a problem hiding this comment.
Плохое решение делать это через программируемые состояния аниматора
There was a problem hiding this comment.
"программируемые состояния аниматора" - это конечный автомат?
| SetCoinsText(); | ||
| } | ||
|
|
||
| private void SetCoinsText() |
There was a problem hiding this comment.
Методы с глаголом Set должны что-то принимать
Это скорей UpdateText
|
|
||
| public class Player : MonoBehaviour | ||
| { | ||
| [SerializeField] private TextMeshProUGUI _coinstext; |
| { | ||
| if (collision.gameObject.TryGetComponent<Player>(out Player player)) | ||
| { | ||
| SceneManager.LoadScene("Menu"); |
There was a problem hiding this comment.
Попробуй воспользоваться нашим плагином - Typed Scenes
|
|
||
| [RequireComponent(typeof(Collider2D))] | ||
| [RequireComponent(typeof(Rigidbody2D))] | ||
| public class Spawned : MonoBehaviour |
|
|
||
| [SerializeField] private TextMeshProUGUI _coinsText; | ||
|
|
||
| private int _coins = 0; |
|
|
||
| public int Coins => _coins; | ||
|
|
||
| [SerializeField] private TextMeshProUGUI _coinsText; |
There was a problem hiding this comment.
по нашим соглашением приватное поле с этим аттрибутом выше обычрного приватного поля
| [SerializeField] protected Transform[] SpawnPoints; | ||
| [SerializeField] protected float SpawnInterval; | ||
|
|
||
| protected float ElapseTime = 0f; |
There was a problem hiding this comment.
протектед поля как и публичные - плохая практика
No description provided.