public static GameObject Convert(IExportContainer container, GameObject origin) { GameObjectLayout layout = container.Layout.GameObject; GameObjectLayout exlayout = container.ExportLayout.GameObject; GameObject instance = new GameObject(container.ExportLayout); EditorExtensionConverter.Convert(container, origin, instance); instance.AssetInfo = origin.AssetInfo; if (exlayout.IsComponentTuple) { instance.ComponentTuple = origin.ComponentTuple.ToArray(); } else { instance.Component = GetComponent(container, origin); } instance.IsActive = GetIsActive(container, origin); instance.Layer = origin.Layer; instance.Name = origin.Name; if (exlayout.HasTag) { instance.Tag = GetTag(container, origin); } if (exlayout.HasTagString) { instance.TagString = GetTagString(container, origin); } #if UNIVERSAL if (layout.HasIcon) { instance.Icon = origin.Icon; } if (layout.HasNavMeshLayer) { instance.NavMeshLayer = origin.NavMeshLayer; instance.StaticEditorFlags = origin.StaticEditorFlags; } else if (exlayout.HasIsStatic && layout.HasIsStatic) { instance.IsStatic = origin.IsStatic; } #endif return(instance); }
public static void Convert(IExportContainer container, NamedObject origin, NamedObject instance) { EditorExtensionConverter.Convert(container, origin, instance); instance.Name = origin.Name; }
public static void Convert(IExportContainer container, Component origin, Component instance) { EditorExtensionConverter.Convert(container, origin, instance); instance.GameObject = origin.GameObject; }