private void CollisionMain(Vector2 NextPos) { HexagonControl hex = MapControl.FieldPosition(gameObject.layer, NextPos); if (_hexagonMain != hex) { if (!hex.IsFree) { if ((EnemyTarget != null) && hex.ObjAbove == EnemyTarget.IMoveMain) { IMoveMain.StopMoveTarget(); } else { IMoveMain.StopMove(hex); } } else { if (hex.TypeHexagon == 1) { Debug.LogError("da"); } _hexagonMain.Gap(); _hexagonMain = hex; _hexagonMain.Contact(IMoveMain); RecordApproac(); TravelMessage(); } } }
private void Start() { //временно _hexagonMain = MapControl.FieldPosition(gameObject.layer, transform.position); _hexagonMain.Contact(IMoveMain); //незабудь удалить transform.position = (Vector2)_hexagonMain.transform.position; RecordApproac(); }
private void CollisionMain(Vector2 NextPos) { HexagonControl hex; if (IMoveMain.IsFlight()) { hex = MapControl.FieldPositionFly(gameObject.layer, NextPos); } else { hex = MapControl.FieldPosition(gameObject.layer, NextPos); } if (_hexagonMain != hex) { if (!hex.GetFree(IMoveMain.IsFlight())) { if ((HeroTarget != null) && hex.ObjAbove == HeroTarget.IMoveMain) { IMoveMain.StopMoveTarget(); } else { IMoveMain.StopMove(hex); } } else { if (IMoveMain.IsFlight()) { _hexagonMain.GapFly(); _hexagonMain = hex; _hexagonMain.ContactFly(IMoveMain); } else { _hexagonMain.Gap(); _hexagonMain = hex; _hexagonMain.Contact(IMoveMain); } RecordApproac(); TravelMessage(); } } }
public void First(EnemyManager manager) { //_navigationBot.Control = this; _enemyManager = manager; if (IMoveMain.IsFlight()) { _hexagonMain = MapControl.FieldPositionFly(gameObject.layer, transform.position); } else { _hexagonMain = MapControl.FieldPosition(gameObject.layer, transform.position); } if (IMoveMain.IsFlight()) { _hexagonMain.ContactFly(IMoveMain); } else { _hexagonMain.Contact(IMoveMain); } RecordApproac(); }