Beispiel #1
0
        public ParticleViewModel(ParticleConfiguration particleConfiguration)
        {
            _rand = new Random();

            ParticleConfiguration = particleConfiguration;
            Update();
        }
 // Token: 0x06000880 RID: 2176 RVA: 0x00037220 File Offset: 0x00035420
 public static void HitMaterialParticles(Vector3 hitPoint, Vector3 hitNormal, ParticleConfiguration particleConfiguration)
 {
     if (particleConfiguration.ParticleEmitter != null)
     {
         Vector3    vector   = Vector3.zero;
         Quaternion rotation = default(Quaternion);
         rotation = Quaternion.FromToRotation(Vector3.back, hitNormal);
         for (int i = 0; i < particleConfiguration.ParticleCount; i++)
         {
             Vector2 vector2 = UnityEngine.Random.insideUnitCircle * UnityEngine.Random.Range(particleConfiguration.ParticleMinSpeed, particleConfiguration.ParticleMaxSpeed);
             vector.x = vector2.x;
             vector.y = vector2.y;
             vector.z = UnityEngine.Random.Range(particleConfiguration.ParticleMinZVelocity, particleConfiguration.ParticleMaxZVelocity) * -1f;
             vector   = rotation * vector;
             particleConfiguration.ParticleEmitter.Emit(hitPoint, vector, UnityEngine.Random.Range(particleConfiguration.ParticleMinSize, particleConfiguration.ParticleMaxSize), UnityEngine.Random.Range(particleConfiguration.ParticleMinLiveTime, particleConfiguration.ParticleMaxLiveTime), particleConfiguration.ParticleColor);
         }
     }
 }
        public ParticleDialogViewModel(ParticleViewModel particleViewModel, IModelValidator <ParticleDialogViewModel> validator) : base(validator)
        {
            _particleViewModel     = particleViewModel;
            _particleConfiguration = particleViewModel.ParticleConfiguration;

            ParticleType = _particleConfiguration.ParticleType;
            MinWidth     = _particleConfiguration.MinWidth;
            MaxWidth     = _particleConfiguration.MaxWidth;
            MinHeight    = _particleConfiguration.MinHeight;
            MaxHeight    = _particleConfiguration.MaxHeight;

            MinRotationVelocityX = _particleConfiguration.MinRotationVelocityX;
            MaxRotationVelocityX = _particleConfiguration.MaxRotationVelocityX;
            MinRotationVelocityY = _particleConfiguration.MinRotationVelocityY;
            MaxRotationVelocityY = _particleConfiguration.MaxRotationVelocityY;
            MinRotationVelocityZ = _particleConfiguration.MinRotationVelocityZ;
            MaxRotationVelocityZ = _particleConfiguration.MaxRotationVelocityZ;

            Path = _particleConfiguration.Path;

            ParticleTypes = new BindableCollection <ValueDescription>(EnumUtilities.GetAllValuesAndDescriptions(typeof(ParticleType)));
        }
 // Token: 0x06000883 RID: 2179 RVA: 0x000374CC File Offset: 0x000356CC
 public static void HitMateriaFullSphericParticles(Vector3 hitPoint, Vector3 hitNormal, ParticleConfiguration particleConfiguration)
 {
     if (particleConfiguration.ParticleEmitter != null)
     {
         Vector3 velocity = Vector3.zero;
         for (int i = 0; i < particleConfiguration.ParticleCount; i++)
         {
             velocity = UnityEngine.Random.insideUnitSphere * UnityEngine.Random.Range(particleConfiguration.ParticleMinSpeed, particleConfiguration.ParticleMaxSpeed);
             particleConfiguration.ParticleEmitter.Emit(hitPoint, velocity, UnityEngine.Random.Range(particleConfiguration.ParticleMinSize, particleConfiguration.ParticleMaxSize), UnityEngine.Random.Range(particleConfiguration.ParticleMinLiveTime, particleConfiguration.ParticleMaxLiveTime), particleConfiguration.ParticleColor);
         }
     }
 }
 // Token: 0x06000882 RID: 2178 RVA: 0x000373FC File Offset: 0x000355FC
 public static void HitMateriaHalfSphericParticles(Vector3 hitPoint, Vector3 hitNormal, ParticleConfiguration particleConfiguration)
 {
     if (particleConfiguration.ParticleEmitter != null)
     {
         Vector3    vector   = Vector3.zero;
         Quaternion rotation = default(Quaternion);
         rotation = Quaternion.FromToRotation(Vector3.back, hitNormal);
         for (int i = 0; i < particleConfiguration.ParticleCount; i++)
         {
             vector = UnityEngine.Random.insideUnitSphere * UnityEngine.Random.Range(particleConfiguration.ParticleMinSpeed, particleConfiguration.ParticleMaxSpeed);
             if (vector.z > 0f)
             {
                 vector.z *= -1f;
             }
             vector = rotation * vector;
             particleConfiguration.ParticleEmitter.Emit(hitPoint, vector, UnityEngine.Random.Range(particleConfiguration.ParticleMinSize, particleConfiguration.ParticleMaxSize), UnityEngine.Random.Range(particleConfiguration.ParticleMinLiveTime, particleConfiguration.ParticleMaxLiveTime), particleConfiguration.ParticleColor);
         }
     }
 }