Esempio n. 1
0
        public WaterConstantRipplesModule(Game2DWater waterObject, WaterConstantRipplesModuleParameters parameters, Transform ripplesEffectsRoot)
        {
            _waterObject = waterObject;

            _isActive                             = parameters.IsActive;
            _updateWhenOffscreen                  = parameters.UpdateWhenOffscreen;
            _randomizeDisturbance                 = parameters.RandomizeDisturbance;
            _smoothRipples                        = parameters.SmoothDisturbance;
            _smoothingFactor                      = parameters.SmoothFactor;
            _disturbance                          = parameters.Disturbance;
            _minimumDisturbance                   = parameters.MinimumDisturbance;
            _maximumDisturbance                   = parameters.MaximumDisturbance;
            _randomizeTimeInterval                = parameters.RandomizeInterval;
            _timeInterval                         = parameters.Interval;
            _minimumTimeInterval                  = parameters.MinimumInterval;
            _maximumTimeInterval                  = parameters.MaximumInterval;
            _randomizeRipplesSourcePositions      = parameters.RandomizeRipplesSourcesPositions;
            _randomRipplesSourceCount             = parameters.RandomizeRipplesSourcesCount;
            _allowDuplicateRipplesSourcePositions = parameters.AllowDuplicateRipplesSourcesPositions;
            _sourcePositions                      = parameters.SourcePositions;

            _ripplesEffectsRoot = CreateRipplesEffectsRoot(ripplesEffectsRoot);

            _particleEffect = new WaterRipplesParticleEffect(parameters.ParticleEffectParameters, _ripplesEffectsRoot);
            _soundEffect    = new WaterRipplesSoundEffect(parameters.SoundEffectParameters, _ripplesEffectsRoot);
        }
Esempio n. 2
0
        public WaterCollisionRipplesModule(Game2DWater waterObject, WaterCollisionRipplesModuleParameters parameters, Transform ripplesEffectsPoolsRootParent)
        {
            _waterObject = waterObject;

            _isOnWaterEnterRipplesActive          = parameters.ActivateOnWaterEnterRipples;
            _isOnWaterExitRipplesActive           = parameters.ActivateOnWaterExitRipples;
            _isOnWaterMoveRipplesActive           = parameters.ActivateOnWaterMoveRipples;
            _collisionIgnoreTriggers              = parameters.CollisionIgnoreTriggers;
            _minimumDisturbance                   = parameters.MinimumDisturbance;
            _maximumDisturbance                   = parameters.MaximumDisturbance;
            _velocityMultiplier                   = parameters.VelocityMultiplier;
            _onWaterMoveRipplesMaximumDisturbance = parameters.OnWaterMoveRipplesMaximumDisturbance;
            _onWaterMoveRipplesMinimumVelocityToCauseMaximumDisturbance = parameters.OnWaterMoveRipplesMinimumVelocityToCauseMaximumDisturbance;
            _onWaterMoveRipplesDisturbanceSmoothFactor = parameters.OnWaterMoveRipplesDisturbanceSmoothFactor;
            _collisionMask                   = parameters.CollisionMask;
            _collisionMinimumDepth           = parameters.CollisionMinimumDepth;
            _collisionMaximumDepth           = parameters.CollisionMaximumDepth;
            _collisionRaycastMaximumDistance = parameters.CollisionRaycastMaxDistance;
            _onWaterEnter = parameters.OnWaterEnter;
            _onWaterExit  = parameters.OnWaterExit;

            _onCollisionRipplesEffectsPoolsRoot = CreateRipplesEffectsPoolsRoot(ripplesEffectsPoolsRootParent);

            _onWaterEnterRipplesParticleEffect = new WaterRipplesParticleEffect(parameters.WaterEnterParticleEffectParameters, _onCollisionRipplesEffectsPoolsRoot);
            _onWaterExitRipplesParticleEffect  = new WaterRipplesParticleEffect(parameters.WaterExitParticleEffectParameters, _onCollisionRipplesEffectsPoolsRoot);
            _onWaterEnterRipplesSoundEffect    = new WaterRipplesSoundEffect(parameters.WaterEnterSoundEffectParameters, _onCollisionRipplesEffectsPoolsRoot);
            _onWaterExitRipplesSoundEffect     = new WaterRipplesSoundEffect(parameters.WaterExitSoundEffectParameters, _onCollisionRipplesEffectsPoolsRoot);
        }
Esempio n. 3
0
        public WaterScriptGeneratedRipplesModule(WaterScriptGeneratedRipplesModuleParameters parameters, Transform ripplesEffectsRootParent)
        {
            _minimumDisturbance = parameters.MinimumDisturbance;
            _maximumDisturbance = parameters.MaximumDisturbance;

            _ripplesEffectsRoot = CreateRipplesEffectsRoot(ripplesEffectsRootParent);

            _particleEffect = new WaterRipplesParticleEffect(parameters.ParticleEffectParameters, _ripplesEffectsRoot);
            _soundEffect    = new WaterRipplesSoundEffect(parameters.SoundEffectParameters, _ripplesEffectsRoot);
        }
Esempio n. 4
0
        public WaterCollisionRipplesModule(WaterCollisionRipplesModuleParameters parameters, Transform ripplesEffectsPoolsRootParent)
        {
            _isOnWaterEnterRipplesActive = parameters.ActivateOnWaterEnterRipples;
            _isOnWaterExitRipplesActive  = parameters.ActivateOnWaterExitRipples;
            _minimumDisturbance          = parameters.MinimumDisturbance;
            _maximumDisturbance          = parameters.MaximumDisturbance;
            _velocityMultiplier          = parameters.VelocityMultiplier;
            _collisionMask                   = parameters.CollisionMask;
            _collisionMinimumDepth           = parameters.CollisionMinimumDepth;
            _collisionMaximumDepth           = parameters.CollisionMaximumDepth;
            _collisionRaycastMaximumDistance = parameters.CollisionRaycastMaxDistance;
            _onWaterEnter = parameters.OnWaterEnter;
            _onWaterExit  = parameters.OnWaterExit;

            _onCollisionRipplesEffectsPoolsRoot = CreateRipplesEffectsPoolsRoot(ripplesEffectsPoolsRootParent);

            _onWaterEnterRipplesParticleEffect = new WaterRipplesParticleEffect(parameters.WaterEnterParticleEffectParameters, _onCollisionRipplesEffectsPoolsRoot);
            _onWaterExitRipplesParticleEffect  = new WaterRipplesParticleEffect(parameters.WaterExitParticleEffectParameters, _onCollisionRipplesEffectsPoolsRoot);
            _onWaterEnterRipplesSoundEffect    = new WaterRipplesSoundEffect(parameters.WaterEnterSoundEffectParameters, _onCollisionRipplesEffectsPoolsRoot);
            _onWaterExitRipplesSoundEffect     = new WaterRipplesSoundEffect(parameters.WaterExitSoundEffectParameters, _onCollisionRipplesEffectsPoolsRoot);
        }