Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        internal void Validate(WaterCollisionRipplesModuleParameters parameters)
        {
            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;

            OnWaterEnterRipplesParticleEffect.Validate(parameters.WaterEnterParticleEffectParameters);
            OnWaterEnterRipplesSoundEffect.Validate(parameters.WaterEnterSoundEffectParameters);
            OnWaterExitRipplesParticleEffect.Validate(parameters.WaterExitParticleEffectParameters);
            OnWaterExitRipplesSoundEffect.Validate(parameters.WaterExitSoundEffectParameters);
        }
Exemplo n.º 3
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);
        }