public virtual IRestoreData GetRestoreData()
        {
            // Material must be RestorableMaterial or DefaultMaterial
            MaterialRestoreData materialRestoreData;

            if (spriteRenderer != null && spriteRenderer.sharedMaterial is RestorableMaterial)
            {
                materialRestoreData = RestorableMaterial.GetRestoreData(spriteRenderer.sharedMaterial);
            }
            else
            {
                materialRestoreData = null;
            }

            int renderQueue = RenderQueueOverrider.Ensure(gameObject).renderQueue;

            return(new CompositeSpriteControllerBaseRestoreData(currentImageName, transform, color, materialRestoreData,
                                                                renderQueue));
        }
Ejemplo n.º 2
0
        public IRestoreData GetRestoreData()
        {
            // Materials must be RestorableMaterial
            var layersData = new List <List <MaterialRestoreData> >();

            foreach (var layer in layers)
            {
                var layerData = new List <MaterialRestoreData>();
                foreach (var material in layer)
                {
                    if (material is RestorableMaterial)
                    {
                        layerData.Add(RestorableMaterial.GetRestoreData(material));
                    }
                }

                layersData.Add(layerData);
            }

            return(new PostProcessingRestoreData(layersData, layersEnabledUntil));
        }