public override void SetDirection(HighwayDirection direction) { if (direction == Direction) { return; } Direction = direction; transform.eulerAngles = new Vector3(0, (int)direction); }
public override void SetDirection(HighwayDirection direction) { if (direction == Direction || direction == HighwayDirection.UP) { return; } Direction = direction; transform.eulerAngles = new Vector3(0, (int)direction * 0.5f); transform.ChangePositionWithChild("FinishPosition"); }
private T GenerateHighway <T>(HighwayDirection cornerDirection, HighwayBase highwayBase, bool rotate = true) where T : HighwayBase { var highway = _poolManager.GetAvailableHighWay <T>(); highway.SetDirection(cornerDirection); if (highwayBase != null) { highway.transform.position = highwayBase.FinishPosition; if (rotate) { highway.transform.Rotate(highwayBase.transform.eulerAngles.y * Vector3.up); } } _levelManager.AddLevel(_levelIndex, highway); return(highway); }
public abstract void SetDirection(HighwayDirection direction);