Ejemplo n.º 1
0
            public override NodeBehaviour Create()
            {
                var oldWall = this.getOldWall();

                var newWall = new EmptyCreator(oldWall.ToJson()).Create();

                newWall.transform.localRotation = oldWall.transform.localRotation;
                newWall.SetParent(oldWall.Parent);
                NodeBehaviour.MoveNodeChildren(oldWall, newWall);

                newWall.nodeType = NodeType.HOLE;

                var top    = createWallPart(" top", oldWall, newWall);
                var bottom = createWallPart(" bottom", oldWall, newWall);
                var right  = createWallPart(" right", oldWall, newWall);
                var left   = createWallPart(" left", oldWall, newWall);

                updateTop(top);
                updateBot(bottom);
                updateRight(right);
                updateLeft(left);

                this.fixHoleOutSideOfQuad(top, bottom, right, left);

                this.deleteNode(oldWall);

                return(newWall);
            }
Ejemplo n.º 2
0
            public override NodeBehaviour Create()
            {
                var parent = new EmptyCreator(this.name, this.position).Create();

                parent.nodeType = NodeType.CUBE;

                createQuad("top", Vector3.up, new Vector3(this.scale.x, this.scale.z, 1), Quaternion.Euler(-90, 0, 0), parent);
                createQuad("floor", Vector3.down, new Vector3(this.scale.x, this.scale.z, 1), Quaternion.Euler(90, 0, 0), parent);
                createQuad("left", Vector3.left, new Vector3(this.scale.z, this.scale.y, 1), Quaternion.Euler(0, -90, 0), parent);
                createQuad("right", Vector3.right, new Vector3(this.scale.z, this.scale.y, 1), Quaternion.Euler(0, 90, 0), parent);
                createQuad("front", Vector3.forward, new Vector3(this.scale.x, this.scale.y, 1), Quaternion.Euler(0, 0, 0), parent);
                createQuad("back", Vector3.back, new Vector3(this.scale.x, this.scale.y, 1), Quaternion.Euler(0, 180, 0), parent);

                return(parent);
            }