public void OnOwnerCharacterSpawned() { //when the shop owner is spawned, set the owner Structure structure = worlditem.Get <Structure>(); WorldItem structureOwner = structure.StructureOwner.worlditem; structure.StructureGroup.Owner = structureOwner; structureOwner.GetOrAdd <ShopOwner>(); }
public static Structure BuildStructureWithoutParent(string templateName) { if (templateName == "all") { Get.StartCoroutine(Get.BuildAllStructures()); } else { WorldItem structureItem = null; WorldItems.CloneWorldItem("WorldPathMarkers", "Shingle 1", STransform.zero, true, WIGroups.Get.World, out structureItem); Structure structure = structureItem.GetOrAdd <Structure> (); structureItem.Props.Name.FileName = templateName; structure.State.TemplateName = templateName; AddExteriorToLoad(structure); return(structure); } return(null); }
public static Signboard GetOrCreateSignboard(Signboard sign, WorldItem owner, WIGroup locationGroup, STransform offset, string textureName, string type) { if (sign == null) { WorldItem newSignWorldItem = null; WorldItems.CloneWorldItem("Decorations", "Signboard", offset, false, locationGroup, out newSignWorldItem); newSignWorldItem.Initialize(); //offset.ApplyTo (newSignWorldItem.transform, false); sign = newSignWorldItem.GetOrAdd <Signboard>(); sign.Owner = owner; sign.TextureName = textureName; sign.Style = SignboardStyle.A; if (!string.IsNullOrEmpty(textureName)) { if (textureName.StartsWith("B_")) { sign.Style = SignboardStyle.B; } //Debug.Log ("Setting signoboard state to " + type + sign.Style.ToString ()); newSignWorldItem.State = type + sign.Style.ToString(); } } return(sign); }