Ejemplo n.º 1
0
 public void PopulateShipRender(int pointsCount, GameObject prefab)
 {
     for (int i = 0; i < pointsCount; i++)
     {
         PointRenderer point = Instantiate(prefab, transform).GetComponent <PointRenderer>();
         point.Point       = Ship._points[i];
         point.Image.color = Ship.Color;
     }
 }
Ejemplo n.º 2
0
        private void Start()
        {
            for (int i = 0; i < 9; i++)
            {
                for (int j = 0; j < 9; j++)
                {
                    PointRenderer pointRenderer = Instantiate(_gameplayManager.PointRendererPrefab, transform).GetComponent <PointRenderer>();
                    pointRenderer.Position = new Vector2(j, i);
                    _points.Add(pointRenderer.Position, pointRenderer);
                }
            }

            _ships = _gameplayManager._ships;
            PopulateBoard();
        }