예제 #1
0
    void FixedUpdate()
    {
        if (RefActivity.GetComponent <PlayerController>().isLocalPlayer)
        {
            scam.FollowObject(transform.position, 0.1f);
        }

        if (count < 1.0f)
        {
            count += speed * Time.deltaTime;

            Vector2 m1 = Vector2.Lerp(P0, P1, count);
            Vector2 m2 = Vector2.Lerp(P1, P2, count);
            transform.position = Vector2.Lerp(m1, m2, count);
            transform.Rotate(Vector3.forward, count * 10.0f);
        }
        else
        {
            if (!InWater)
            {
                InWater = isInWater();
                refActivity.IsFishing = InWater;
                Anim.enabled          = true;
                animInChild.enabled   = true;
                currentPos            = transform.position;
                Anim.Play("idle_hook");
                transform.rotation = Quaternion.identity;
                if (!refActivity.IsFishing)
                {
                    refActivity.ResetStates();
                    Destroy(gameObject);
                    Destroy(refActivity.FishingRod);
                }
            }

            if (sprRend.sprite.name == "hook_10")
            {
                sprRend.enabled = false;
                refActivity.PossibleHookedFish = true;
                transform.position             = currentPos + Random.insideUnitCircle * 0.01f;
            }
            else
            {
                refActivity.PossibleHookedFish = false;
                transform.position             = currentPos;
                sprRend.enabled = true;
            }
        }
    }