/// <summary> /// This function helper for create random Hexagon. /// </summary> private HexagonController CreateHexagon(Hexagon hexagon, SlotController slotController, bool isOut = false) { if (hexagon == null) { bool isBonus = Random.Range(0, 10) == 5; int colorId = Random.Range(0, gameSettings.Colors.Length); hexagon = new Hexagon(colorId, gameSettings.Colors[colorId], isBonus); } HexagonController hexagonController = Instantiate(gameSettings.HexagonPrefab, slotController.transform, false); if (isOut) { hexagonController.transform.position = slotController.transform.TransformVector(new Vector3(slotController.transform.localPosition.x, InterfaceManager.Instance.GetOutScreenYAxis(CommonTypes.HEXAGON_HEIGHT), 0)); } hexagonController.Initialize(hexagon, slotController); hexagonControllers.Add(hexagonController); Debug.Log($"Hexagon is Created. ColorId : {hexagonController.GetColorId()} Coordinate : {hexagonController.GetCoordinate()}"); return(hexagonController); }