Exemplo n.º 1
0
        private void _loadDoor(Asset asset)
        {
            GameObject go = AssetPackUtilities.LoadAsset <GameObject>(_bundle, asset.Guid);

            if (go == null)
            {
                throw new Exception("Can't find Object:" + asset.Guid);
            }

            WallBuilder <Door> doorBuilder = Parkitility.CreateWall <Door>(go)
                                             .Id(asset.Guid)
                                             .BuildLayerMask(LayerMasks.TERRAIN)
                                             .Price(asset.Price, false)
                                             .DisplayName(asset.Name)
                                             .CustomColor(AssetPackUtilities.ConvertColors(asset.CustomColors, asset.ColorCount))
                                             .BlockRain(asset.BlocksRain)
                                             .HeightChangeDelta(asset.HeightDelta)
                                             .SnapGridToCenter(true)
                                             .OnGrid(true)
                                             .GridSubdivisions(1f)
                                             .Category(asset.Category, asset.SubCategory)
                                             .SeeThrough(asset.SeeThrough);

            if (asset.IsResizable)
            {
                doorBuilder.Resizable(asset.MinSize, asset.MaxSize);
            }

            doorBuilder.Build(_assetManagerLoader);
        }
Exemplo n.º 2
0
    public void Click(object h)
    {
        RaycastHit hit           = (RaycastHit)h;
        GameObject hitGameObject = hit.collider.gameObject;

        Debug.Log("HIT ON '" + hitGameObject.name + "' RECEIVED IN '" + gameObject.name + "'");

        WallBuilder wb = Wall.GetComponent <WallBuilder>();

        wb.Build();
    }
Exemplo n.º 3
0
        private void Awake()
        {
            BlockBuilder b     = new LooseBlock();
            var          block = b.Build(new Vector3(0.0f, 0.0f, 0.0f), 8, 0.5f);

            block.AddComponent <BlockCollision>();
            var r = block.AddComponent <Rigidbody>();

            r.useGravity = false;
            block.AddComponent <BlockRotation>();
            block.AddComponent <BlockMovement>();


            Camera.main.GetComponent <PanTarget>().Target = block.transform;

            var w    = new WallBuilder();
            var wall = w.Build(new Vector3(0.0f, 0.0f, 20.0f), new Dimensions(1, 21, 21), block, 0.5f);

            Helper.RandomlyOrientate(block);
        }