示例#1
0
 private void MoveToMidPoint()
 {
     this.mSpeed  = Mathf.Max(this.mSpeed - this.mDamping * Time.get_deltaTime(), 0.0f);
     this.mDelay -= Time.get_deltaTime();
     if ((double)this.mDelay > 0.0)
     {
         return;
     }
     this.mOnUpdate = new GemParticle.UpdateEvent(this.MoveToGoal);
 }
示例#2
0
 private void DelayedDeactivate()
 {
     foreach (ParticleSystem componentsInChild in (ParticleSystem[])((Component)this).GetComponentsInChildren <ParticleSystem>())
     {
         if (componentsInChild.get_particleCount() > 0)
         {
             return;
         }
     }
     this.mOnUpdate = (GemParticle.UpdateEvent)null;
     ((Component)this).get_gameObject().SetActive(false);
 }
示例#3
0
    private void MoveToGoal()
    {
        this.mSpeed += this.mAccel * Time.get_deltaTime();
        Vector3 vector3 = Vector3.op_Subtraction(Vector3.op_Addition(this.TargetObject.get_position(), this.TargetOffset), ((Component)this).get_transform().get_position());
        float   num     = this.mSpeed * Time.get_deltaTime();

        if ((double)Vector3.Dot(vector3, vector3) <= (double)num * (double)num)
        {
            GameUtility.StopEmitters(((Component)this).get_gameObject());
            this.mSpeed    = 0.0f;
            this.mOnUpdate = new GemParticle.UpdateEvent(this.DelayedDeactivate);
        }
        else
        {
            ((Component)this).get_transform().set_rotation(Quaternion.LookRotation(vector3));
        }
    }
示例#4
0
 public void Reset()
 {
     this.mDelay    = this.Delay * Random.Range(0.9f, 1.1f);
     this.mSpeed    = this.Speed * Random.Range(0.9f, 1.1f);
     this.mDamping  = this.Damping * Random.Range(0.9f, 1.1f);
     this.mAccel    = this.Accel * Random.Range(0.9f, 1.1f);
     this.mOnUpdate = new GemParticle.UpdateEvent(this.MoveToMidPoint);
     ParticleSystem[] componentsInChildren1 = (ParticleSystem[])((Component)this).get_gameObject().GetComponentsInChildren <ParticleSystem>(true);
     for (int index = 0; index < componentsInChildren1.Length; ++index)
     {
         ParticleSystem.EmissionModule emission = componentsInChildren1[index].get_emission();
         // ISSUE: explicit reference operation
         ((ParticleSystem.EmissionModule)@emission).set_enabled(true);
     }
     if (!Object.op_Inequality((Object)this.Prefab, (Object)null))
     {
         return;
     }
     ParticleSystem[] componentsInChildren2 = (ParticleSystem[])((Component)this.Prefab).GetComponentsInChildren <ParticleSystem>(true);
     for (int index = 0; index < componentsInChildren2.Length && index < componentsInChildren1.Length; ++index)
     {
         componentsInChildren1[index].set_loop(componentsInChildren2[index].get_loop());
     }
 }