Ejemplo n.º 1
0
    void StartFlying()
    {
        BirdAnimator animator = GetComponent("BirdAnimator") as BirdAnimator;

        animator.StartFlying();

        transform.position   = OppositeSideTargetPoint(RandomScreenPoint());
        transform.localScale = new Vector3(scale, scale, scale);

        approaching = false;
    }
Ejemplo n.º 2
0
    void StartApproach()
    {
        if (!approaching)
        {
            BirdAnimator animator = GetComponent("BirdAnimator") as BirdAnimator;
            animator.StartApproach();

            Vector3 newPosition = Camera.main.WorldToScreenPoint(transform.position);
            newPosition.z      = 9;
            transform.position = Camera.main.ScreenToWorldPoint(newPosition);

            approaching     = true;
            approachCounter = 0;
            approachIsRight = IsRightOfObstacle();
        }
    }