Example #1
0
        static public void setPosition(GameObject o, Hex hex)
        {
            HexGridLib.Point p = hex.centre();
            Vector3          vecteurPosition = new Vector3((float)p.x, 0.01f, (float)p.y);

            o.transform.position = vecteurPosition;
        }
Example #2
0
        static public GameObject Plot(GameObject o, Hex hex)
        {
            // instancie un objet au centre de son Hex, appelé par Display
            HexGridLib.Point p = hex.centre();
            Vector3          vecteurPosition = new Vector3((float)p.x, 0.01f, (float)p.y);
            GameObject       go = (GameObject)Instantiate(o, vecteurPosition, o.transform.rotation);

            return(go);
        }
Example #3
0
        static public GameObject Plot(GameObject o, Hex hex, Dictionary <Hex, GameObject> mapHexGameobject)
        {
            // instancie un objet au centre de son Hex, appelé par Display
            // et met à jour mapHexGameobject
            HexGridLib.Point p = hex.centre();
            Vector3          vecteurPosition = new Vector3((float)p.x, 0.01f, (float)p.y);
            GameObject       go = (GameObject)Instantiate(o, vecteurPosition, o.transform.rotation);

            if (!mapHexGameobject.ContainsKey(hex))
            {
                mapHexGameobject.Add(hex, go);
            }
            return(go);
        }