Пример #1
0
 void OnCollisionEnter2D()
 {
     JuiceBox.Rattle(door);
     Destroy(door, 0.6f);
     JuiceBox.Rattle(door2);
     Destroy(door2, 0.6f);
     JuiceBox.Wobble(View, 0.5f);
     Destroy(gameObject);
 }
Пример #2
0
 public void DamagePlayer(int damageAmount)
 {
     // Checks if the health is more than 0.
     if (health > 0)
     {
         // Rattles the camera.
         JuiceBox.Rattle(Camera.main.gameObject, rattlePower, rattleTime);
         // Damages the player by the damageAmount.
         health = health - damageAmount;
         // Updates the Health GUI.
         UpdateHealth();
     }
 }
Пример #3
0
    // A nice easy use of the Rattle function.
    // A good way to show an object was bumped/clicked/etc.

    void OnMouseDown()
    {
        JuiceBox.Rattle(gameObject);
    }
Пример #4
0
    // A full version of Rattle.
    // Control the force and duration of the rattle.

    void OnMouseDown()
    {
        JuiceBox.Rattle(gameObject, 20, 1.8f);
    }