Skip to content

code/vladimir rezyapkin/butterfly test - #96

Open
Dant777 wants to merge 1 commit into
FitiLsan:example/rabbit-aifrom
Dant777:code/vladimir-rezyapkin/butterfly-test
Open

code/vladimir rezyapkin/butterfly test#96
Dant777 wants to merge 1 commit into
FitiLsan:example/rabbit-aifrom
Dant777:code/vladimir-rezyapkin/butterfly-test

Conversation

@Dant777

@Dant777 Dant777 commented Oct 28, 2020

Copy link
Copy Markdown
Contributor

butterfly test

@MSnihurska MSnihurska left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Отличная работа! За исключением пары ошибок в оромлении, сам код хороший.
Советую обратить внимание на InteractableObject и Rabbit - у них нет отдельных контроллеров. Они обрабатываются общим EnemyController, за счет иерархии классов и наследования от EnemyModel и EnemyData.

Comment on lines +1 to +30
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Move : MonoBehaviour
{
public Transform Center;
public float angle = 0;

public float speed = 1;
public float radius = 1f;

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
//transform.position = Vector3.MoveTowards(transform.position, target.position, Time.deltaTime);
angle += Time.deltaTime;
var x = Mathf.Cos(angle * speed) * radius;
var z = Mathf.Sin(angle * speed) * radius;
transform.position = new Vector3(x, Center.position.y, z) + Center.position;

//transform.RotateAround(Center.position, Vector3.up, 10 * Time.deltaTime );
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Забыли удалить :)

using System;
using System.Collections.Generic;
using System.Linq;
using Assets.Scripts.EntityScripts.Example.Butterfly;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Тут и дальше: для примера хорошее решение, но для сущностей в проекте лучше писать в общем пространстве имен BeastHunter

Comment on lines +22 to +26
_angle += Time.deltaTime;
var x = Mathf.Cos(_angle * speed) * radius;
var z = Mathf.Sin(_angle * speed) * radius;
transform.position = new Vector3(x, 1f, z) + new Vector3(-3.58f, 1f, 15.43f);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Привести в соответствие с Code Convention (убрать магические цифры и лишние строки)

@Dant777

Dant777 commented Oct 28, 2020 via email

Copy link
Copy Markdown
Contributor Author

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