wangguan
2020-12-17 faf10bb580f90298fe5583953b0951610e81635c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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());
            }
            
        }
    }
}