コード例 #1
0
        private static NetInfo BuildVersion(this INetInfoBuilder builder, NetInfoVersion version, ICollection<NetInfo> holdingCollection)
        {
            if (builder.SupportedVersions.HasFlag(version))
            {
                var completePrefabName = NetInfos.Vanilla.GetPrefabName(builder.TemplatePrefabName, version);
                var completeName = builder.GetNewName(version);

                var info = Prefabs
                    .Find<NetInfo>(completePrefabName)
                    .Clone(completeName);

                info.SetUICategory(builder.UICategory);
                builder.BuildUp(info, version);

                holdingCollection.Add(info);

                return info;
            }
            else
            {
                return null;
            }
        }
コード例 #2
0
        public static NetInfo BuildVersion(this INetInfoBuilder builder, NetInfoVersion version, ICollection<Action> lateOperations)
        {
            if (builder.SupportedVersions.HasFlag(version))
            {
                var basedPrefabName = builder.GetBasedPrefabName(version);
                var builtPrefabName = builder.GetBuiltPrefabName(version);

                var info = Prefabs
                    .Find<NetInfo>(basedPrefabName)
                    .Clone(builtPrefabName);

                builder.BuildUp(info, version);

                var lateBuilder = builder as INetInfoLateBuilder;
                if (lateBuilder != null)
                {
                    lateOperations.Add(() => lateBuilder.LateBuildUp(info, version));
                }

                return info;
            }
            else
            {
                return null;
            }
        }
コード例 #3
0
        private static NetInfo BuildVersion(this INetInfoBuilder builder, NetInfoVersion version, Action<NetInfo> assign, ICollection<NetInfo> holdingCollection)
        {
            if (builder.SupportedVersions.HasFlag(version))
            {
                var completePrefabName = builder.GetPrefabName(version);
                var completeName = builder.GetNewName(version);

                var info = ToolsCSL
                    .FindPrefab<NetInfo>(completePrefabName)
                    .Clone(completeName);

                info.SetUICategory(builder.UICategory);
                builder.BuildUp(info, version);

                if (assign != null)
                {
                    assign(info);
                }

                holdingCollection.Add(info);

                return info;
            }
            else
            {
                if (assign != null)
                {
                    assign(null);
                }
            }

            return null;
        }