FANDOM


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace AC
{
		[RequireComponent (typeof (ParticleSystem))]
		public class RememberParticle : Remember
		{
				public override string SaveData ()
				{
						ParticleData particleData = new ParticleData ();
						particleData.isOn = GetComponent <ParticleSystem> ().isPlaying;
						particleData.objectID = constantID;

						return Serializer.SaveScriptData <ParticleData> (particleData);
				}

				public override void LoadData (string stringData)
				{
						
						ParticleData data = Serializer.LoadScriptData <ParticleData> (stringData);
						if (data == null) return;
						if(data.isOn) GetComponent <ParticleSystem> ().Play();

				}

		[System.Serializable]
		public class ParticleData : RememberData
		{
				public bool isOn;
				public ParticleData () { }

		}
}
}

themightyzq

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.