public WITemplate(WorldItem worlditem) { Name = worlditem.Props.Name.PrefabName; StackItem si = worlditem.GetTemplate(); Props.CopyLocalNames(si.Props); Props.CopyGlobalNames(si.Props); Props.CopyLocal(si.Props); Props.Global = worlditem.Props.Global; SaveState = si.SaveState; Props.Local.Mode = WIMode.Unloaded; Props.Local.PreviousMode = WIMode.Unloaded; WIStates states = null; if (worlditem.gameObject.HasComponent <WIStates>(out states)) { ObjectStates.AddRange(states.States); } }