예제 #1
0
 void OnDisable()
 {
     if (ParticleAsset != null)
     {
         ParticleAsset.Stop();
     }
 }
예제 #2
0
    public void Play()
    {
        gameObject.SetActive(true);
        if (IsInit == true)
        {
            if (ParticleAsset != null)
            {
                ParticleAsset.Stop();
                if (play_type == eUIParticlePlay.DeltaTime)
                {
                    ParticleAsset.Play(false, 0);
                }
                else
                {
                    if (ContinueTime == false)
                    {
                        ParticleAsset.Delay = Time.realtimeSinceStartup;
                    }
                    ParticleAsset.Play(true, 0);
                }

                ParticleAsset.SetLightingMax(1f);
                if (IsAutoPlay == true && ContinueTime == true)
                {
                    ParticleAsset.PlaybackTime = PlaybackTime;
                }
                else
                {
                    PlaybackTime = 0f;
                }
            }
            return;
        }

        IsInit = true;

        if (string.IsNullOrEmpty(particle_name))
        {
            return;
        }

        PlaybackTime  = 0f;
        ParticleAsset = GameObject.Instantiate <HFX_ParticleSystem>(AssetManager.GetParticleSystem(particle_name));
        if (ParticleAsset != null)
        {
            ParticleAsset.transform.SetParent(transform, false);
            ParticleAsset.gameObject.SetActive(true);
            if (ContinueTime == false && play_type == eUIParticlePlay.RealTimeSinceStartup)
            {
                ParticleAsset.Delay = Time.realtimeSinceStartup;
            }
            ParticleAsset.Play(play_type == eUIParticlePlay.RealTimeSinceStartup, 0);
            ParticleAsset.SetLightingMax(1f);
        }
        else
        {
            Debug.LogWarningFormat("particle not found : {0}", particle_name);
        }
    }
예제 #3
0
 override protected void OnDisable()
 {
     base.OnDisable();
     if (ParticleAsset != null)
     {
         ParticleAsset.Stop();
     }
 }
예제 #4
0
 public void Stop()
 {
     if (IsInit == true)
     {
         if (ParticleAsset != null)
         {
             ParticleAsset.Stop();
         }
         return;
     }
 }