public void CollideWithBody(HardlightSuit body, Collider col, Vector3 where) { //Default sequence, gets reassigned HapticSequence seq = body.GetSequence("pulse"); //Depending on the type of projectile that we are. switch (typeOfCollision) { case CollisionType.MinorCoinHit: //Hit the body with a simple effect name - which should be in "Resources/Haptics/<Name>" body.HitNearest(lastPosition, "click"); break; case CollisionType.SharpImpact: body.FindNearbyLocation(lastPosition); body.HitImpulse(lastPosition, body.GetSequence("pain_short"), .1f, 1, 0); //body.HitImpulse(lastPosition, Effect.Pulse, .2f, .35f, 1, 2); break; case CollisionType.ThudImpact: //This plays an effect across all found pads within a range. body.HitNearby(lastPosition, "click", BigImpactArea); break; case CollisionType.MediumCashPackHit: body.HitNearest(lastPosition, "pulse"); break; case CollisionType.SackOfGoldhit: //More helper function usage. This asset is from the Death and Dying pack (which is a very intense effect) seq = body.GetSequence("pain_short"); //This makes use of the other HitImpulse which allows for repeated effects. body.HitImpulse(lastPosition, seq, .2f, 2, 3, .15f, 1.0f); break; case CollisionType.MudBlob: seq = body.GetSequence("pulse"); body.HitImpulse(lastPosition, seq, .02f, 5, 3, .15f, 1.0f); break; } }
public void CollideWithBody(HardlightSuit body, Collider col, Vector3 where) { //Default sequence, gets reassigned HapticSequence seq = body.GetSequence("pulse"); //Depending on the type of projectile that we are. switch (typeOfCollision) { case CollisionType.Hit: //Hit the body with a simple effect name - which should be in "Resources/Haptics/<Name>" body.HitNearest(lastPosition, "double_click"); break; case CollisionType.HitImpulse: //Plays a simple impulse on the assumed impact point. body.HitImpulse(lastPosition, Effect.Pulse, .2f, .35f, 1, 2); break; case CollisionType.BigImpact: //This plays an effect across all found pads within a range. body.HitNearby(lastPosition, "buzz", BigImpactArea); break; case CollisionType.RepeatedImpulse: //More helper function usage. This asset is from the Death and Dying pack (which is a very intense effect) seq = body.GetSequence("pain_short"); //This makes use of the other HitImpulse which allows for repeated effects. body.HitImpulse(lastPosition, seq, .2f, 2, 3, .15f, 1.0f); break; } }