public override void BindToParkitect(GameObject hider, AssetBundle bundle) { base.BindToParkitect(hider, bundle); BaseDecorator baseDecorator = DecoratorByInstance <BaseDecorator>(); CategoryDecorator categoryDecorator = DecoratorByInstance <CategoryDecorator>(); ColorDecorator colorDecorator = DecoratorByInstance <ColorDecorator>(); BoundingBoxDecorator boxDecorator = DecoratorByInstance <BoundingBoxDecorator>(); GameObject go = Instantiate(bundle.LoadAsset <GameObject>(Key)); Wall wall = go.AddComponent <Wall>(); wall.name = Key; wall.categoryTag = categoryDecorator.Category; wall.price = baseDecorator.Price; wall.setDisplayName(baseDecorator.InGameName); wall.dontSerialize = true; wall.isPreview = true; if (colorDecorator.IsRecolorable) { CustomColors colors = go.AddComponent <CustomColors>(); colors.setColors(colorDecorator.Colors.ToArray()); } foreach (var box in boxDecorator.BoundingBoxes) { var b = go.AddComponent <BoundingBox>(); b.setBounds(box.Bounds); } }
public override void BindToParkitect(GameObject hider, AssetBundle bundle) { BaseDecorator baseDecorator = DecoratorByInstance <BaseDecorator>(); SeatDecorator seatDecorator = DecoratorByInstance <SeatDecorator>(); ColorDecorator colorDecorator = DecoratorByInstance <ColorDecorator>(); BoundingBoxDecorator boxDecorator = DecoratorByInstance <BoundingBoxDecorator>(); CategoryDecorator categoryDecorator = DecoratorByInstance <CategoryDecorator>(); GameObject gameObject = Instantiate(bundle.LoadAsset <GameObject>(Key));; gameObject.transform.parent = hider.transform; _seat = gameObject.AddComponent <Seating>(); _seat.name = Key; RemapUtility.RemapMaterials(gameObject); baseDecorator.Decorate(gameObject, hider, this, bundle); colorDecorator.Decorate(gameObject, hider, this, bundle); categoryDecorator.Decorate(gameObject, hider, this, bundle); foreach (var box in boxDecorator.BoundingBoxes) { var b = Prefab.AddComponent <BoundingBox>(); b.setBounds(box.Bounds); } AssetManager.Instance.registerObject(_seat); }
public override void BindToParkitect(GameObject hider, AssetBundle bundle) { BaseDecorator baseDecorator = DecoratorByInstance <BaseDecorator>(); GridDecorator gridDecorator = DecoratorByInstance <GridDecorator>(); CategoryDecorator categoryDecorator = DecoratorByInstance <CategoryDecorator>(); ColorDecorator colorDecorator = DecoratorByInstance <ColorDecorator>(); BoundingBoxDecorator boxDecorator = DecoratorByInstance <BoundingBoxDecorator>(); GameObject gameObject = Instantiate(bundle.LoadAsset <GameObject>(Key)); gameObject.transform.parent = hider.transform; _deco = gameObject.AddComponent <Deco>(); _deco.name = Key; _deco.buildOnLayerMask = 4096; _deco.heightChangeDelta = gridDecorator.HeightDelta; _deco.defaultGridSubdivision = gridDecorator.GridSubdivision; _deco.buildOnGrid = gridDecorator.Grid; _deco.defaultSnapToGridCenter = gridDecorator.Snap; _deco.isPreview = true; _deco.isStatic = true; _deco.dontSerialize = true; RemapUtility.RemapMaterials(gameObject); baseDecorator.Decorate(gameObject, hider, this, bundle); colorDecorator.Decorate(gameObject, hider, this, bundle); categoryDecorator.Decorate(gameObject, hider, this, bundle); foreach (var box in boxDecorator.BoundingBoxes) { var b = gameObject.AddComponent <BoundingBox>(); b.setBounds(box.Bounds); } AssetManager.Instance.registerObject(_deco); }
public override void BindToParkitect(GameObject hider, AssetBundle bundle) { BaseDecorator baseDecorator = DecoratorByInstance <BaseDecorator>(); CategoryDecorator categoryDecorator = DecoratorByInstance <CategoryDecorator>(); BoundingBoxDecorator boxDecorator = DecoratorByInstance <BoundingBoxDecorator>(); PathStyle c = AssetManager.Instance.pathStyles.getPathStyle("concrete"); PathStyle ps = new PathStyle(); ps.handRailGO = c.handRailGO; ps.handRailRampGO = c.handRailRampGO; Material mat = Instantiate(c.material); mat.mainTexture = bundle.LoadAsset <Texture>(PathTexturePath); ps.material = mat; ps.platformTileMapper = AssetManager.Instance.platformTileMapper; ps.identifier = Key; ps.spawnSound = c.spawnSound; ps.despawnSoundEvent = c.despawnSoundEvent; ps.spawnLastSound = c.spawnLastSound; ps.spawnTilesOnPlatforms = true; _pathStyle = ps; switch (PathType) { case PathType.Normal: AssetManager.Instance.pathStyles.registerPathStyle(ps); break; case PathType.Queue: AssetManager.Instance.queueStyles.registerPathStyle(ps); break; case PathType.Employee: AssetManager.Instance.employeePathStyles.registerPathStyle(ps); break; } }