Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        base.Start();

        zoom_factor = 4f;
        ColorizeMethod colorizer = colorize;

        make_map(32, colorizer, "TacticalTile");
    }
Exemplo n.º 2
0
    protected void make_map(int r, ColorizeMethod colorize, string prefab_name)
    {
        tiles        = new Dictionary <int, Dictionary <int, Dictionary <int, GameObject> > >();
        radius_tiles = new Dictionary <int, Dictionary <int, HexadrantTiles> >();

        for (int x = -r; x <= r; x++)
        {
            for (int y = -r; y <= r; y++)
            {
                int z = -(x + y);

                if (Mathf.Abs(z) > r)
                {
                    continue;
                }

                if (!tiles.ContainsKey(x))
                {
                    tiles[x] = new Dictionary <int, Dictionary <int, GameObject> >();
                }
                if (!tiles[x].ContainsKey(y))
                {
                    tiles[x][y] = new Dictionary <int, GameObject>();
                }

                GameObject hex_sprite = (GameObject)Instantiate(Resources.Load(prefab_name));
                HexGrid    hex_grid   = hex_sprite.GetComponent <HexGrid>();

                Vector3 pl = hex_grid.spawn(x, y, z);
                hex_sprite.transform.position = pl;

                int radius    = hex_grid.radius;
                int hexadrant = hex_grid.hexadrant;

                if (!radius_tiles.ContainsKey(radius))
                {
                    radius_tiles[radius] = new Dictionary <int, HexadrantTiles>();
                }

                if (!radius_tiles[radius].ContainsKey(hexadrant))
                {
                    radius_tiles[radius][hexadrant] = new HexadrantTiles();
                }

                radius_tiles[radius][hexadrant].Add(hex_sprite);
                colorize(hex_sprite, r);

                tiles[x][y][z] = hex_sprite;

                if (z > r)
                {
                    break;
                }
            }
        }
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        base.Start();

        ColorizeMethod colorizer = colorize;

        make_map(23, colorizer, "SkillTile");

        SkillLoader skl = GetComponent <SkillLoader>();

        skl.Build();
        SkillStruct ss = skl.get_struct();

        apply_skills_to_hex_grid_map(ss);
        populate_rest();
        activate_ground_zero();
    }
 public object Colorize(ColorizeMethod method, params object[] options)
 {
     return null;
 }
 public void InvokeOnUIThread(ColorizeMethod colorize) {
   TextBox.BeginInvoke(new MethodInvoker(colorize));
 }
Exemplo n.º 6
0
 public void InvokeOnUIThread(ColorizeMethod colorize)
 {
     TextBox.BeginInvoke(new MethodInvoker(colorize));
 }
 public object Colorize(ColorizeMethod method, params object[] options)
 {
     return(null);
 }