using UnityEngine;
namespace TowerDefense.Effects
{
///
/// Simple class to switch between two separate game objects depending on whether we're
/// on a mobile platform or not
///
public class MobileParticleSelector : MonoBehaviour
{
///
/// System to use on non-mobile platforms
///
public ParticleSystem defaultParticles;
///
/// System to use on mobile platforms
///
public ParticleSystem mobileParticles;
protected virtual void Awake()
{
ParticleSystem selectedSystem;
/**/
#if UNITY_STANDALONE
// 永远都使用移动特效:
//selectedSystem = defaultParticles;
selectedSystem = mobileParticles;
#else
selectedSystem = mobileParticles;
#endif
selectedSystem = mobileParticles;
defaultParticles.gameObject.SetActive(selectedSystem == defaultParticles);
try
{
mobileParticles.gameObject.SetActive(selectedSystem == mobileParticles);
}catch( System.Exception e )
{
Debug.Log(e.ToString());
}
}
}
}