public static IGameObject createGameObject(int row, int col, BallsTypes type, bool isPlayer = false) { IGameObject gameObject; switch (type) { case BallsTypes.Universal: gameObject = new UniversalBubble(type); break; default: gameObject = new Bubble(type); break; } Color32 color = getColor(type); Vector3 pos; if (isPlayer) { pos = FieldManager.findCoordsForPlayer(); } else { pos = FieldManager.findCoordsByRowCol(row, col); gameObject.row = row; gameObject.col = col; } gameObject.createShape(FieldManager.CELL_WIDTH * 0.5f, pos.x, pos.y, color, FieldManager.gamePivot); gameObject.setActive = true; return(gameObject); }
public List <(IGameObject obj, float percents)> OnPlayerShot(UniversalBubble obj, float angle) { return(MagicBallController.OnPlayerShot(obj, angle)); }