コード例 #1
0
ファイル: Puppets.cs プロジェクト: iboy/shadowengine
    static void Init()
    {
        Debug.Log("In ShadowEngine Window Init");

        // Get existing open window or if none, make a new one:
        Puppets window = ( Puppets )EditorWindow.GetWindow(typeof(Puppets));

        window.Show();
    }
コード例 #2
0
        public bool AppendBodyModelItem(BodyModelItem pBodyModelItem, List <string> pPuppetTextures, bool pLoadAnimations, out string pErrorText)
        {
            // string puppetName = pBodyModelItem.PuppetName;
            BodyModelSumPuppet puppet = null;

            if (Puppets != null)
            {
                puppet = SearchPuppet(pBodyModelItem.PuppetName);
            }
            else
            {
                Puppets = new List <BodyModelSumPuppet>();
            }

            if (puppet == null)
            {
                puppet = new BodyModelSumPuppet(pBodyModelItem.PuppetName, Archiver);
                Puppets.Add(puppet);
            }

            return(puppet.AppendData(pBodyModelItem, pPuppetTextures, pLoadAnimations, out pErrorText));
        }
コード例 #3
0
        // ---------------------------------------------------------------------------------------------------------


        public bool PopulateSummary(out string pErrorText, AddonPackageSource pSource = null, string pTempFolderPath = null, List <BodyModelItem> pBodyModels = null)
        {
            pErrorText = null;
            if (_initialized)
            {
                return(true);
            }

            if (!PopulateSummaryPreChecks(ref pSource, ref pTempFolderPath, ref pBodyModels, out pErrorText))
            {
                return(false);
            }

            bool   isOk                    = true;
            string assetDataFile           = null;
            bool   deleteTempAssetDataFile = false;

            try
            {
                if (pSource.SourceType == AddonPackageSourceType.Folder)
                {
                    assetDataFile = Path.Combine(pSource.SourcePath, AddonPackage.AssetDataFilename);
                }
                else
                {
                    assetDataFile = Path.Combine(pTempFolderPath, AddonPackage.AssetDataFilename);
                    pSource.Archiver.ArchivedFilesExtract(pTempFolderPath, new List <string>()
                    {
                        AddonPackage.AssetDataFilename
                    });
                    deleteTempAssetDataFile = true;
                }

                List <string> puppetTextureList = GetPuppetTextures(pSource);

                SevenZipArchiver mftArchiver = new SevenZipArchiver(assetDataFile);

                foreach (BodyModelItem item in pBodyModels)
                {
                    if (Puppets == null)
                    {
                        Puppets = new BodyModelSumPuppets(mftArchiver);
                    }
                    if (!Puppets.AppendBodyModelItem(item, puppetTextureList, LoadAnimations, out pErrorText))
                    {
                        isOk = false;
                        break;
                    }
                }
            }
            catch (Exception exception)
            {
                pErrorText = $"BodyModelsSummary.PopulateSummary() EXCEPTION: {exception.Message}";
                isOk       = false;
            }
            finally
            {
                if (deleteTempAssetDataFile)
                {
                    File.Delete(assetDataFile);
                }
            }

            _initialized = isOk;

            return(isOk);
        }