示例#1
0
    static StringBuilder GetSpawnFactoryJson(SpawnFactory pFactory, ref StringBuilder pResources)
    {
        StringBuilder aFactoryComponents = new StringBuilder();
        GSprite       aSprite            = new GSprite(pFactory.mDisplaySprite.rect, pFactory.mTextureGUID,
                                                       pFactory.mDisplaySprite.texture.height, (int)pFactory.mRenderLayer);

        SaveAssetData(GetAssetFromGUID(pFactory.mTextureGUID, AssetMetaData.AssetType.TextureAsset), ref pResources);
        aFactoryComponents.Append(aSprite.ToString() + ",\n");
        GPolygonCollider aCollider = new GPolygonCollider(pFactory.mIsTrigger);

        aFactoryComponents.Append(aCollider.ToString() + ",\n");
        SFactory aFactory = new SFactory(pFactory.mEnemyGUID, pFactory.mPoolCount, pFactory.mSpawnTime);

        SaveEnemyPrefab(GetAssetFromGUID(pFactory.mEnemyGUID, AssetMetaData.AssetType.PrefabAsset), ref pResources);
        aFactoryComponents.Append(aFactory.ToString());
        return(aFactoryComponents);
    }