using UnityEngine;
|
|
namespace TowerDefense.Effects
|
{
|
/// <summary>
|
/// Simple class to switch between two separate game objects depending on whether we're
|
/// on a mobile platform or not
|
/// </summary>
|
public class MobileParticleSelector : MonoBehaviour
|
{
|
/// <summary>
|
/// System to use on non-mobile platforms
|
/// </summary>
|
public ParticleSystem defaultParticles;
|
/// <summary>
|
/// System to use on mobile platforms
|
/// </summary>
|
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());
|
}
|
|
}
|
}
|
}
|