예제 #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;
    }
예제 #2
0
파일: Map.cs 프로젝트: haiduchyk/HexaPlay
    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);
    }