Пример #1
0
        public void GenerateMap(int Largeur, int Longeur)//GenerateMap
        {
            MapWidth  = Largeur;
            MapHeight = Longeur;
            for (int x = 0; x < Largeur; x++)
            {
                for (int y = 0; y < Longeur; y++)
                {
                    TileInfo   TI   = new TileInfo(x, y);                                                                //Tile info
                    GameObject TIGO = GameObject.Instantiate(TilePrefab, TI.Position(), Quaternion.identity, MapHolder); //Tile PRefab
                    Mapping(TIGO, TI, x, y);                                                                             //Mapping des deux dans mes dictionaires
                    TI.MyVisual = TIGO;

                    PreVisualUpdates();
                    VisualUpdate(TI);
                    PostVisualUpdates();
                }
            }
            AfterGeneration();
        }
Пример #2
0
 public void GenerateMap(Texture2D Map2D1)
 {
     MapWidth  = Map2D1.width;
     MapHeight = Map2D1.height;
     Map2D     = Map2D1;
     for (int x = 0; x < MapWidth; x++)
     {
         for (int y = 0; y < MapHeight; y++)
         {
             Color      P    = Map2D1.GetPixel(x, y);
             TileInfo   TI   = new TileInfo(x, y, P);                                                             //Tile info
             GameObject TIGO = GameObject.Instantiate(TilePrefab, TI.Position(), Quaternion.identity, MapHolder); //Tile PRefab
             Mapping(TIGO, TI, x, y);                                                                             //Mapping des deux dans mes dictionaires
             TI.MyVisual = TIGO;
             PreVisualUpdates();
             VisualUpdate(TI);
             PostVisualUpdates();
         }
     }
     AfterGeneration();
 }
 public void DefaultMoveEffect(GameObject Unit, Procedural.Hex.TileInfo from, Procedural.Hex.TileInfo to)//Effet de deplacement par default
 {
     Unit.transform.position = to.Position();
     // print("Move from" + from.Coox + "," + from.Cooy + " to " + to.Coox + "," + to.Cooy);
 }