Example #1
0
    void changePositionAndRotate(Node oldEnemy, Node newEnemy, Enemy component)
    {
        component.SetRotation(oldEnemy, newEnemy);
        var x = newEnemy.coor[0];
        var y = newEnemy.coor[1];

        component.target = DrawHex.Position(x, y);
        component.node   = newEnemy;
    }
Example #2
0
    public GameObject instantiate(Node node, GameObject prefab)
    {
        int        x   = node.coor[0];
        int        y   = node.coor[1];
        GameObject obj = (GameObject)Instantiate(
            prefab,
            DrawHex.Position(x, y),
            Quaternion.identity,
            this.transform
            );

        obj.name = string.Format("{0}, {1}", x, y);
        return(obj);
    }