// Use this for initialization
    void Start()
    {
        world = GameObject.FindWithTag("world").GetComponent("World") as World;

        displayBlock = new BlockSelect();
        filter = gameObject.GetComponent<MeshFilter>();
        coll = gameObject.GetComponent<MeshCollider>();
    }
Beispiel #2
0
        public void ActionCallsBlockSelect()
        {
            var mockController    = new Mock <IController>();
            var position          = new Coordinate(4, 5);
            var blockSelectAction = new BlockSelect(mockController.Object, position);

            blockSelectAction.Execute();

            mockController.Verify(controller => controller.SelectBlock(position), Times.Once());
        }
    // Use this for initialization
    void Start()
    {
        GameObject tempgo = GameObject.FindWithTag ("world");
        world = tempgo.GetComponent("World") as World;

        camera = Camera.main;
        mainCanvas = GameObject.FindWithTag ("UI");

        corner = new GameObject[8];
        for(int a = 0; a < 8; a+=1)
        {
            //this creates a circle for each corner to act as a handle to drag
            GameObject point = corner[a];
            point = Instantiate (handleUI, new Vector3 (targetPosition.x, targetPosition.y, targetPosition.z), Quaternion.identity) as GameObject;
            point.transform.SetParent(mainCanvas.transform);

            corner[a] = point;
            setcorner(point, a);

        }

        displayBlock = new BlockSelect();
        filter = gameObject.GetComponent<MeshFilter>();
        //coll = gameObject.GetComponent<MeshCollider>();
    }