Skip to content

Refactor#31

Open
VKladov wants to merge 3 commits into
HolyMonkey:masterfrom
VKladov:refactor
Open

Refactor#31
VKladov wants to merge 3 commits into
HolyMonkey:masterfrom
VKladov:refactor

Conversation

@VKladov
Copy link
Copy Markdown

@VKladov VKladov commented Jan 25, 2021

Done!


public class MoveIncideCircle : MonoBehaviour
{
[SerializeField] private float _maxDistance = 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.

_radius

using System.Collections.Generic;
using UnityEngine;

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

Нет такого слова

[SerializeField] private float _maxDistance = 4;
[SerializeField] private float _speed = 2;

private Vector3 _targetPosition;
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.

_target

Comment thread Assets/Group1/Scripts/Player.cs Outdated
Comment on lines +31 to +45
private IEnumerator ResetSpeed(float delay)
{
yield return new WaitForSeconds(delay);
_speed = _defaultSpeed;
_boostResetCoroutine = null;
}

private void BoostSpeed(float multiplier, float duration)
{
if (_boostResetCoroutine != null)
StopCoroutine(_boostResetCoroutine);

_speed = _defaultSpeed * multiplier;
_boostResetCoroutine = StartCoroutine(ResetSpeed(duration));
}
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.

Перемудрил. Это всё в 3 строки можно записать

Comment thread Assets/Group1/Scripts/SpeedBoost.cs Outdated
using System.Collections.Generic;
using UnityEngine;

public class SpeedBoost : MoveIncideCircle
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 thread Assets/Group1/Scripts/Player.cs Outdated
Comment on lines +40 to +41
if (_boostResetCoroutine != null)
StopCoroutine(_boostResetCoroutine);
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