Esempio n. 1
0
    public void JumpOver(GameObject other, GameObject lookAt = null, float jumpPower = 1)
    {
        float   topOffset = (BoundaryInfo.Height(other) / 2f) + (bearHeight / 2f);
        Vector3 dest      = other.transform.position + new Vector3(0, topOffset, 0);

        print("Jump to " + other + " " + dest);

        transform.DOKill(true);          // Stop current movement.
        transform.DOJump(dest, jumpPower, 1, 1f)
        .SetEase(Ease.OutQuart).OnComplete(() => {
            if (lookAt)
            {
                transform.LookAt(lookAt.transform);
            }
        });

        currentIceburg = other.GetComponent <Iceburg> ();
        if (currentIceburg)
        {
            currentIceburg.melt = true;
        }
        animator.Play("Jump");
    }
Esempio n. 2
0
 public void RemoveIceburg(Iceburg other)
 {
     watchingIceburgs.Remove(other.gameObject);
 }