private void OnCollisionExit(Collision collision) { if (UtilExtensions.IsLayerInLayerMask(BuildController.BuildLayerMask, collision.gameObject.layer)) { isGrounded = false; } }
private void OnCollisionStay(Collision collision) { if (!isGrounded && UtilExtensions.IsLayerInLayerMask(BuildController.BuildLayerMask, collision.gameObject.layer)) { isGrounded = true; } }
private void OnCollisionEnter(Collision collision) { if (canDetectBuildingBlocks && !hasHitBuildingBlock && UtilExtensions.IsLayerInLayerMask(buildingBlockLayerMask, collision.gameObject.layer)) { hasHitBuildingBlock = true; StartCoroutine("LightFuse"); } }
private void OnCollisionEnter(Collision collision) { if (!collisionDetected) { StopLaunchSoundEffect(); PlayCollisionSoundEffect(); PlayCollisionEffect(collision); spin.Stop(); trailParticleSystem.Stop(); } if (UtilExtensions.IsLayerInLayerMask(ProjectileController.Singleton.StructureLayerMask, collision.gameObject.layer) && !hitStructure) { hitStructure = true; if (collision.gameObject.GetComponent <BuildingBlockCopy>() is BuildingBlockCopy) { ChallengesController.BlocksHitByProjectiles++; } } collisionDetected = true; }
private void OnCollisionEnter(Collision collision) { if (!UtilExtensions.IsLayerInLayerMask(VehicleController.Singleton.GroundLayerMask, collision.gameObject.layer)) // If the collision is with NOT the ground, then execute: { if (!collisionDetected) // Check if we've already collided. { PlayCollisionSoundEffect(); PlayCollisionEffect(collision); StopWheelDustEffect(); collisionDetected = true; } if (UtilExtensions.IsLayerInLayerMask(VehicleController.Singleton.StructureLayerMask, collision.gameObject.layer) && !hitStructure) { RoundController.Singleton.EndRound(); hitStructure = true; ChallengesController.VehicleHitStructure = true; } } }