IEnumerator SaveRoutine(string saveName) { isSaving = true; PlaygroundSave data = new PlaygroundSave(); data.settings = PlaygroundC.Particle(); data.settings.isSnapshot = true; yield return null; data.Save(this); while (data.IsSaving()) yield return null; data.settings.transform.parent = particleSystemTransform; data.settings.transform.name = saveName; data.settings.timeOfSnapshot = localTime; data.name = saveName; data.time = localTime; data.particleCount = particleCount; data.lifetime = lifetime; data.version = PlaygroundC.version; snapshots.Add (data); PlaygroundC.reference.particleSystems.Remove (data.settings); #if UNITY_EDITOR if (!PlaygroundC.reference.showSnapshotsInHierarchy) data.settings.gameObject.hideFlags = HideFlags.HideInHierarchy; #endif isSaving = false; }
/// <summary> /// Returns a copy of this PlaygroundSave. /// </summary> public PlaygroundSave Clone() { PlaygroundSave playgroundSave = new PlaygroundSave(); settings.CopyTo(playgroundSave.settings); playgroundSave.name = name; playgroundSave.time = time; playgroundSave.lifetime = lifetime; playgroundSave.particleCount = particleCount; playgroundSave.loadMode = loadMode; playgroundSave.loadTransform = loadTransform; playgroundSave.loadMaterial = loadMaterial; playgroundSave.setMaterialAfterTransition = setMaterialAfterTransition; playgroundSave.material = material; playgroundSave.transitionMultiplier = transitionMultiplier; playgroundSave.transitionType = transitionType; playgroundSave.unfolded = unfolded; return playgroundSave; }
// Return a copy of this PlaygroundSave public PlaygroundSave Clone () { PlaygroundSave playgroundSave = new PlaygroundSave(); settings.CopyTo(playgroundSave.settings); playgroundSave.name = name; playgroundSave.time = time; playgroundSave.lifetime = lifetime; playgroundSave.particleCount = particleCount; playgroundSave.loadMode = loadMode; playgroundSave.loadTransform = loadTransform; playgroundSave.transitionMultiplier = transitionMultiplier; playgroundSave.transitionType = transitionType; return playgroundSave; }