コード例 #1
0
        public static DecoBuilder <TDeco> FromDeco <TDeco>(GameObject go, Asset asset) where TDeco : Deco
        {
            DecoBuilder <TDeco> builder = Parkitility.CreateDeco <TDeco>(go)
                                          .Id(asset.Guid)
                                          .DisplayName(asset.Name)
                                          .Price(asset.Price, false)
                                          .Category(asset.Category, asset.SubCategory)
                                          .SeeThrough(asset.SeeThrough)
                                          .BlockRain(asset.BlocksRain)
                                          .SnapGridToCenter(asset.SnapCenter)
                                          .GridSubdivisions(asset.GridSubdivision);

            if (asset.IsResizable)
            {
                builder.Resizable(asset.MinSize, asset.MaxSize);
            }
            if (asset.HasCustomColors)
            {
                builder.CustomColor(ConvertColors(asset.CustomColors));
            }
            foreach (var bound in ConvertBoundingBox(asset.BoundingBoxes.ToArray()))
            {
                builder.AddBoundingBox(bound);
            }

            return(builder);
        }