public void Decorate(GameObject go, CustomSceneryV1 customScenery) { if (go.GetComponent<Deco>() != null) { go.GetComponent<Deco>().defaultGridSubdivision = customScenery.GridSubdivision; } }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { string type = customScenery.Type; switch (type) { case "deco": (new DecoDecorator()).Decorate(go, customScenery); break; case "trashbin": (new TrashBinDecorator()).Decorate(go, customScenery); break; case "seating": (new SeatingDecorator()).Decorate(go, customScenery); break; case "fence": (new FenceDecorator()).Decorate(go, customScenery); break; case "lamp": (new LampDecorator()).Decorate(go, customScenery); break; default: Debug.Log(type + "is no valid type"); break; } }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { if (go.GetComponent<Deco>() != null) { go.GetComponent<Deco>().defaultSnapToGridCenter = customScenery.SnapCenter; } }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { if (go.GetComponent<Deco>() != null) { go.GetComponent<Deco>().buildOnGrid = customScenery.BuildOnGrid; } }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { if (go.GetComponent<BuildableObject>() != null && customScenery.Recolorable) { CustomColors cc = go.AddComponent<CustomColors>(); cc.setColors(customScenery.Colors); foreach (Material material in AssetManager.Instance.objectMaterials) { if (material.name == "CustomColorsDiffuse") { SetMaterial(go, material); // edge case for fences Fence fence = go.GetComponent<Fence>(); if (fence != null) { if (fence.flatGO != null) { SetMaterial(fence.flatGO, material); } if (fence.postGO != null) { SetMaterial(fence.postGO, material); } } break; } } } }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { go.AddComponent<Deco>(); if (Math.Abs(customScenery.HeightDelta) > 0.01f) (new HeightDecorator()).Decorate(go, customScenery); if (Math.Abs(customScenery.GridSubdivision) > 0.01f) (new GridDecorator()).Decorate(go, customScenery); if (Math.Abs(customScenery.GridSubdivision) > 0.01f) (new GridSubdivisionDecorator()).Decorate(go, customScenery); if (customScenery.SnapCenter) (new SnapToCenterDecorator()).Decorate(go, customScenery); }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { go.AddComponent<Fence>(); if (customScenery.FenceFlat != null) { go.GetComponent<Fence>().flatGO = customScenery.FenceFlat; } if (customScenery.FencePost != null) { go.GetComponent<Fence>().postGO = customScenery.FencePost; } go.GetComponent<Fence>().hasMidPosts = false; }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { go.AddComponent<TrashBin>(); }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { go.AddComponent<Seating>(); go.GetComponent<Seating>().hasBackRest = customScenery.HasBackRest; }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { go.GetComponent<BuildableObject>().setDisplayName(customScenery.Name); go.name = customScenery.Name; }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { go.AddComponent<PathAttachment>(); }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { go.GetComponent<BuildableObject>().price = customScenery.Price; }
public void Decorate(GameObject go, CustomSceneryV1 customScenery) { go.GetComponent<Deco>().heightChangeDelta = customScenery.HeightDelta; }