Пример #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
 void OnCollisionEnter2D(Collision2D coll)
 {
     // Checks if it has collided with a player.
     if (coll.gameObject.tag == "Player")
     {
         // Checks if the player has less than max health.
         if (coll.gameObject.GetComponent <PlayerHealth>().health < 3)
         {
             // Heals the player by the healAmount.
             coll.gameObject.GetComponent <PlayerHealth>().HealPlayer(healAmount);
             // The Item dissapears.
             JuiceBox.PopOut(gameObject);
             // Destroys the item after 3 seconds.
             Destroy(gameObject, 3f);
         }
     }
 }
Пример #4
0
    // A nice easy use of the Rock function.
    // Rocking objects will rotate endlessly back and forth (Z-axis only).

    void Start()
    {
        JuiceBox.Rock(gameObject);
    }
Пример #5
0
    // A nice easy use of the Wobble function.
    // A good way to show an object was bumped/clicked/etc.

    void OnMouseDown()
    {
        JuiceBox.Wobble(gameObject);
    }
Пример #6
0
    // A more customisable version of Jiggle.
    // Control the force of the jiggle by changing the number.

    void OnMouseDown()
    {
        JuiceBox.Jiggle(gameObject, .3f);
    }
Пример #7
0
    // A nice easy use of the PopOut function.
    // A juicy way to hide objects.
    // Note: does not delete the object.

    void OnMouseDown()
    {
        JuiceBox.PopOut(gameObject);
    }
Пример #8
0
    // A more customisable version of Rock.
    // Control the angle and duration.

    void Start()
    {
        JuiceBox.Rock(gameObject, 15, .4f);
    }
Пример #9
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);
    }
Пример #10
0
    // A more customisable version of PopIn.
    // Control the duration of the pop by changing the number.

    void Start()
    {
        JuiceBox.PopIn(gameObject, 2f);
    }
Пример #11
0
    // The full version of PopIn, using all 4 options.
    // Control the duration of the pop, the delay before popping and the type of easing.

    void Start()
    {
        JuiceBox.PopIn(gameObject, .6f, 1, iTween.EaseType.easeOutBack);
    }
Пример #12
0
    // A full version of Rattle.
    // Control the force and duration of the rattle.

    void OnMouseDown()
    {
        JuiceBox.Rattle(gameObject, 20, 1.8f);
    }
Пример #13
0
    // A full version of Rock.
    // Control the angle, duration and easing of the rocking.

    void Start()
    {
        JuiceBox.Rock(gameObject, 20, .6f, iTween.EaseType.linear);
    }
Пример #14
0
    // The full version of PopOut, using all 4 options.
    // Control the duration of the pop, the delay before popping and the type of easing.

    void OnMouseDown()
    {
        JuiceBox.PopOut(gameObject, .6f, .5f, iTween.EaseType.easeOutBounce);
    }